Hello guys,
I want to make a conditional cause in the following file using awk:
awk '{ if ($2 != 0) print $1, $2, $3}' test.csv > test2.csv
FILE EXAMPLE = test.csv
string,number,date
abc,0,20050101
def,1,20060101
ghi,2,20040101
jkl,12,20090101
mno,123,20020101 ... (2 Replies)
I have a large file where some lines have been split into two lines; some of them even with white spaces before the second line. e.g in the following text I want to merge only specific lines ( say UNIX is cool), also removing white spaces only between them, others shall remain same on the output.... (4 Replies)
hi,
I have the following problem:
- 6 different files that have one key in common.
- this six files must be aggregated in one output file sorted by the key.
- the main file has to be writen twice, one in the beggining of the new output file and another in the end, for each key.
- add one... (3 Replies)
Hi, I have file like this -
ABC 123
ABC 456
ABC 321
CDE 789
CDE 345
FGH 111
FGH 222
FGH 333
XYZ 678
I need the output like this:
ABC 123,456
CDE 789,345
FGH 111, 222
XYZ 678
Meaning I want to concat the lines that have the same first column, but I only need the first two... (10 Replies)
Hi All
this may be somewhere in internet , but couldnt find the it.
i have file as
abc01
2010-07-01 12:45:24
2010-07-01 12:54:35
abc02
2010-07-01 12:59:24
2010-07-01 01:05:13
abc03
.
.
.
the output using awk should look like this
abc01|2010-07-01 12:45:24|2010-07-01 12:54:35... (3 Replies)
Hi ,
Need help in concating two lines based on certain character, for example my file has the messages :
:57A:qweqweww
:58A:qeqewqeqe
-}$
{1:fffff2232323}{2:123123dasds}{4:
:20:121323232323232
:21:sdsadasdasddadad
if the line ends with "-}$" or if a line starts with "{1:" then it... (5 Replies)
I would like to print string between two sequent digits and concatenate it into one single line.
input.txt
99 cord, rope, strand, twine,
twist, 100 strand, twine, twist,
cord, rope 101 strand, twine,
twist, twine, twist, cord, rope
105 cord, rope ,twi ... (8 Replies)
I have a file with line 4 : F SITE SPA_M2 SPA_M3 SPA_M4
and a line 237 with: BV_N4 VbdGO_PW Rs_NW_STI Rc_N+OD
need a awk liner to concat the two lines so that line 2 sits next to line1 and looks like:
F SITE SPA_M2 SPA_M3 SPA_M4 BV_N4 VbdGO_PW ... (8 Replies)