All Questions
47 questions
2
votes
7
answers
730
views
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 ...
0
votes
1
answer
59
views
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","...
1
vote
3
answers
108
views
get specific output in linux after string
Controller loading lists...
-------------------------------------------------
command: select SERVICE_NAME from <table_name>
-------------------------------------------------
...
0
votes
2
answers
196
views
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.
3
votes
2
answers
6k
views
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
...
5
votes
4
answers
504
views
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|...
-1
votes
2
answers
262
views
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, ...
-1
votes
1
answer
137
views
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 ...
4
votes
3
answers
176
views
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
...
1
vote
2
answers
2k
views
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 ...
0
votes
1
answer
1k
views
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 = ‘...
1
vote
3
answers
185
views
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 ...
2
votes
2
answers
345
views
copy from psv file to excel file for multiple columns
My PSV file looks like
Column1|Column2|Column3
Web_Value_in_file|123|OLA
Tab_Value_out_file|453|OLA
Source & target columns are different.
I want to cut the value from column1 to multiple columns ...
0
votes
1
answer
370
views
Scripting curl requests in bash
What is given:
Statistic server which gives reply on how many ip addresses within a range correspond to a given rule.
Server which is contacted through http using pattern:
curl http://server/p?q=(...
1
vote
2
answers
2k
views
How to get a random adjective or noun?
I did find a list of words in /usr/share/dict/words but I don't know if there's a way (an already existing way?) to split them up into their corresponding part of speech? Alternatively, I'm fine with ...