Actually I just tried to print using tab, my requirement is not tab separated.
I just want to receive input from user that, which column u wants to print..
if user gives input as all it has to display all column,
suppose if user gives input like this.. 1,2,3,5,7 it has to display these columns as given in a order....
---------- Post updated at 01:42 AM ---------- Previous update was at 01:41 AM ----------
Actually I just tried to print using tab, my requirement is not tab separated.
I just want to receive input from user that, which column u wants to print..
if user gives input as all it has to display all column,
suppose if user gives input like this.. 1,2,3,5,7 it has to display these columns as given in a order....
---------- Post updated at 01:42 AM ---------- Previous update was at 01:41 AM ----------
So, if the requirement is not tab separated output fields, what is the requirement for the output field separator?
I looked at your attachment. The last character of the last field on each line is a carriage return. So, any request to print field 8 followed by any other field will overwrite data sent to a video output device. This can easily be seen if you pipe the output through od -c. Will you remove these spurious carriage returns from your input files before feeding them into the script you're requesting, or does the script have to do that too?
Other than the fact that your fields have variable numbers of spaces instead of a single character as the field separator, you haven't said why cut won't do what you need. If you strip off leading spaces on each line and convert other occurrences of one or more spaces to a single space or tab, I don't see why cut won't do what you need.
Example:
I have files in below format
file 1:
zxc,133,joe@example.com
cst,222,xyz@example1.com
File 2 Contains:
hxd
hcd
jws
zxc
cst
File 1 has 50000 lines and file 2 has around 30000 lines :
Expected Output has to be :
hxd
hcd
jws (5 Replies)
Hi dears
i use bash shell
i have INPUT.txt
like this
number of columns different in one
some row have 12 , some 11 columns
see last column
INPUT.txt
CodeGender Age Grade Dialect Session Sentence Start End Length Phonemic Phonetic
63 M 27 BS/BA TEHRANI 3 4 298320 310050... (2 Replies)
I have a file with class c IP addresses that I need to match to a column and print the matching lines of another file.
I started playing with grep -if file01.out file02.out but I am stuck as to how to match it to a column and print the matching lines;
cat file01.out
10.150.140... (5 Replies)
I am trying to allow a user to enter in text and then store that text in a variable $gene to run in an awk command in which those values are used to run some calculations. I am getting syntax errors however, when I try. Thank you :).
The awk runs great if it is a pre-defined file that is used,... (7 Replies)
Hi,
My input files is like this
axis1 0 1 10
axis2 0 1 5
axis1 1 2 -4
axis2 2 3 -3
axis1 3 4 5
axis2 3 4 -1
axis1 4 5 -6
axis2 4 5 1
Now, these are my following tasks
1. Print a first column for every two rows that has the same value followed by a string.
2. Match on the... (3 Replies)
this may be basic thing for everyone here, but i cant push awk to print the variable user input which is INS, please help.
code:
INS=$1
printf '\n'
symdg list | grep $INS-clone | awk -v i=$INS '{ID=substr($4,9,4)}{print "Device Group: "$1,"at Array "ID,i}'
output:
$ ./test.sh patty
... (5 Replies)
Hi,
echo "Enter file name of input file list along with absolute path : "
read inputFileList
if
then
for string in `cat inputFileList`
do
echo $string
done
else
echo " file does not exist"
fi
From the above code, if the user enters a invalid file... (1 Reply)
Hi friends,
My file is like:
Second file is :
I need to print the rows present in file one, but in order present in second file....I used
while read gh;do
awk ' $1=="' $gh'" {print >> FILENAME"output"} ' cat listoffirstfile
done < secondfile
but the output I am... (14 Replies)
I'm having problems since few days ago, and i'm not able to make it works with a simple awk+grep script (or other way to do this).
For example, i have a input file1.txt:
cat inputfile1.txt
218299910417
1172051195
1172070231
1172073514
1183135117
1183135118
1183135119
1281440202
... (3 Replies)