awk is a good tool to work with individual fields, as in your case.
Please see below:
If you are not familiar with awk, here are few hints so you can make it work for your specifics. the -F '|' tells awk to use pipe as field delimiter, the $3 is third field, the $0 is whole line
I have tried to show the file name whose size is greater than 200 byte in current directory.
Please help me.
ls -l | tr -s " " " " | cut -f 5,9 -d " " >out.txt
#set -a x `cat out.txt`
i=0
`cat out.txt` | while
do
read x
echo $x
#re=200
j=0
if }" < "200" ]
then
echo $j
j=`expr $j... (2 Replies)
Is there any way to write to a text file with scripting? I need to write to a text file two lines of text for the amount of files in the current directory. (9 Replies)
Hi,
We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Hi,
Can anyone please help me with this issue.
I have a Awk command which take file as input, and provides the output having multiple lines, its working in command mode, but not if i plug it in script.
#!/bin/ksh
infile=a.txt
outfile=b.txt
awk '
BEGIN{
FS=OFS="|";ORS = "\n";... (1 Reply)
hello world, i was looking for exemples for writing ans reading in / from a file, more exactly a text file; and how i'm only at very beagining, if anyone have some exemples very simple, very 'classic' , -with explications- and not hard to undersand . i was wondering that some of you are theacher... (6 Replies)
Hey guyz,
I have a table like this:
1 A=#;B=#;C=#
2 A=#;C=#;D=#;E=#;E=#
3 B=#;B=#;B=#;D=#
# are just some numbers. I want to have the output like this:
* 1 2 3
A # # NA
B # NA #
C # # NA
D NA # #
E NA # NA
So basically, I wanna know in each of the rows in my input (which... (9 Replies)
I have got a file in following format:
AAAAAAA
BBBBBBBB
CCCCCCC
DDDDDDD
I am trying to read this file and out put it in following format:
AAAAAAA,BBBBBBB,CCCCCCC,DDDDDD
Preferred method is shell or Perl.
Any help appreciated. (11 Replies)
Hello Guys, How all are doing?
I have an issue in Unix and want help from all of you
I have a file in UNIX which it read by line by line , If at the end of line '0' is written the it should fetch that line into another file and change '0' to '1'
and If at the end of line '1' is written then it... (10 Replies)
Hello,
How can I use a conditional to produce an output file that varies with respect to the contents of column #4 in the data file:
Data file:
9780020080954 9.95 0.49 AS 23.3729
9780020130857 9.95 0.49 AS 23.3729
9780023001406 22.20 0.25 AOD ... (12 Replies)
Hi All
Please Help
Read input write multply output with creteria
Exemple i have file
abc 111 444
abc 111 444
def 111 444
def111 444
bbb 111 444
bbb 111 444
i would need write 3 files pos 1-3 is the Criteria
output would be file1 contains abc file2 def file3 bbb
... (3 Replies)