Skip to main content

All Questions

2votes
7answers
734views

Shell Script to Normalize the data

We have requirement to normalize the data ... Item field is comma delimited and irregular and it may have any items from 0 to max (lets say 100) Input: key1|desc field|item1,item2,item3,item4|extra ...
0votes
2answers
196views

put a string in the beginning of a file, + a 3 digit incremental value

I want to put a string in the beginning of a file, + a 3 digit incremental value. Like this, ABC DEF GHI ... to string001 ABC string002 DEF string003 GHI ........... so on and so forth. Thankyou.
3votes
3answers
226views

Read columns from file, then column into an exsisting csv file

Essentially, I have a csv file that contain multiple columns, called cols.csv 1,a,100 2,b,200 3,c,300 4,e,400 and I have a new csv file that has one column, called col.csv f g h i I want to copy the ...
0votes
1answer
59views

Text processing - Modify based off two different files

I have two files named one.txt containing "297","237","14",NULL,"51.195.14.201","02:00:00:1a:1c:06","255.0.0.0","10.0.10.1","...
1vote
3answers
108views

get specific output in linux after string

Controller loading lists... ------------------------------------------------- command: select SERVICE_NAME from <table_name> ------------------------------------------------- ...
4votes
3answers
176views

Transposing a rows to columns in a cyclic order using shell script

I would like to transpose rows to columns in a cyclic order and also ignoring column headers from 2nd occurrence. For example I have below data [ID] 10 [NAME] TOM [AGE] 25 [ID] 11 [NAME] SAM [AGE] 26 ...
1vote
4answers
1kviews

grep can't get the word I need, but Linux continues to do the next job. How do I stop it?

I have quite a few txt files. They contain the word 'Minimum' (it only shows once in each file), and I want to get the line that contains this word, and show the line in a new file. To do this, I use ...
3votes
2answers
6kviews

How to iterate over list of list ( nested list ) in bash?

I have list of list such as : data = [ ['a', 'b' ], ['a1', 'b1'], ['c1', 'd1' ] ] I want to iterate over and access both elements of each nested list same time something like: for elements in ?? do ...
5votes
4answers
504views

Reformat timestamp in a pipe delimited file

I have a pipe delimited file with date time in this format yyyymmddhhmmss as below. John|Doe|TEST|20210728120821|[email protected] John|Davis|TEST|20210828120821|[email protected] John|Smith|TEST|...
-1votes
2answers
262views

Copy column B if column E or F is empty or comes with value 0

I have a CSV file, and I want to use a bash with command awk or anything else to modify this file. For example, I want to copy column B if column E or F comes empty or with the value of 0 AAAA, BBBB, ...
-1votes
1answer
137views

Custom data formatting and pattern matching

I am trying to format custom data using pattern match. I am not getting expected format. Though I am not shell script savvy but I was able to build a script based on references from multiple sources ...
0votes
2answers
283views

Filter a file, multiply a value in the lines that contain certain string, return all lines

With grep filter a file, from that filtered lines do a math operation on a specific column, only in the lines that contains a string "value=", return all the lines from the first grep filter ...
1vote
2answers
2kviews

How can I delete everything after a word from multiple line in a file

In the following file: semi1245 5465 and taxes ?>:" foo 214 sdnfv 1>?<: Wed dsfsdf 46 and gsdgsd blah and blah taxes foo 214 sdnfv 1>?<: Wed sadfaads I want to delete ...
0votes
1answer
1kviews

Filter rows which has multiple conditions

I'm trying to generate new csv file from an existing csv file of 3.2 GB with , as delimiter. However, the output which I'm getting is a 0B csv file. Condition is to Filter all the tweets with lang = ‘...
1vote
3answers
185views

Simple shell script unable to go through thousands of files; starts fine, but throws "unexpected EOF while looking for matching `"`" after some time

Shell Script in Question Let me explain what I am trying to do by e.g. so you can understand better. Let's say I have 100 .torrent files in a directory. 2 of them will download xxx.epub and yyy.epub ...

153050per page
close