If i have a delimited file such as;
A=1|B=2|C=3|D=4|E=5|F=6
and I want to extract certain fields and print them on one line using only standard unix tools (i.e grep,awk,cut). How could I do this?
The text fields may not always be in the same order and there may be more on one line than on another.
I have a variable like this(Tab seperated):
"a b c d"
I want to read fields one by one, but the problem is number of fields are not fixed, I mean the variable may contain no field or 3 fields or 100 fields or more.
I don't know the best way I can handle it.
Can any one show me a good way?
I am working on a large csv file with all coma separated entries. The entire document is composed of plain numbers, except for a few columns reflecting currencies that are formatted as text. For example, one such entry may look like "$12,345.67" and another one like "$1,234,567.89" (double quote symbols are also included as part of the entries).
This is not a question about appending a new line of text to a file; it's about appending data to each row.
I have over 300 lines in a CSV file, and I want to add more text to each line separated with commas (a format used for MS Excel charts).
From the ex.txt file:
12:11, 321
12:12, 23
I want to append more fields to each line, like this:
12:11, 321, 222, 55
12:12, 23, 33, 402
Hi,
I need to parse input file from 2nd line.
Input file contents are,
Code:
ABC123;20100913115432;2000000;NO;
04;AAA;09;DDD;601020304;AAAA;1;OPTA1;OPTA2;;;
04;BBB;09;BBB;601020304;BBBB;0;OPTB1;OPTB2;OPTB3;OPTB4;OPTB5;
04;CCC;09;DDD;601020304;CCCC;1;;;;;
For each line,
1] I need to check number of fields should be 12 and check 7th field value.
Code:
fields=$(IFS=\;; set -- $line; echo $#)
I am a beginner to scripting, please help me in this regard.
How do I create a script that provides a count of distinct values of all the fields in the pipe delimited file ? I have 20 different files with multiple columns in each file.
Example line from syslog file:
Aug 1 10:25:50 10.10.10.1 id=firewall sn=XXXX time="2012-08-01 14:35:18 UTC" fw=x.x.x.x pri=6 c=1024 m=537 msg="Connection Closed" f=11 n=195273698 src=x.x.x.x:60246:X3: dst=x.x.x.x:443:X6:host.domain.com proto=tcp/https sent=181793 rcvd=649678
I want to do a
$ tail -f /var/log/log.log | SOMETHING
That will return
"src=x.x.x.x dst=x.x.x.x"
In plainspeak I
Hi guys, I am new to android development, I have some problems with an activity.The activity has two edit text fields.The data entered in these edit text fields gets saved in the database .Now when I try to re enter the data in these text fields, I just can't.The edit text fields should get editable when a button in the activity is pressed.Here's the code:
"
// Initially two edit text fie
Hi all,
I been looking for a solution to the fact that when I use:
Code:
for (i=1; i<=NF; i++) print $i
fields that are originally in a single line are printed in a single line
I have severals files for which the first 7 are the same, but the number of variables after that can vary, for example NF is 16, 46, 109, etc...
I want to change the codes AAA, BBB and CCC for numbers, for ex,