10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I have a data file 'File2' consisting of 105670 lines. I want to copy and paste 17928 lines from 'File1' to 'File2' but I want to place it in between lines 21 and 17950 of 'File2'. How do I do it in awk?
For example-
File A has 5 lines
X
Y
1 2 3
4 5 6
7 8 9
and File B has
A
b... (1 Reply)
Discussion started by: ananyob
1 Replies
2. Shell Programming and Scripting
Hi
I have a data file 'File2' consisting of 105670 lines. I want to copy and paste 17928 lines from 'File1' to 'File2' but I want to place it in between lines 21 and 17950 of 'File2'. How do I do it in awk?
For example-
File A has 5 lines
X
Y
1 2 3
4 5 6
7 8 9
and File B has
A
b... (1 Reply)
Discussion started by: ananyob
1 Replies
3. Shell Programming and Scripting
Hi,
I have a file with rows like below delimited with pipe (|)
I want to remove all the leading and trailing white space from each and every fields keeping the delimiter intact.
I have tired this
sed 's/*//g;s/*$//g'
but the result is incorrect
it is removing a whitespace from... (6 Replies)
Discussion started by: COD4
6 Replies
4. Shell Programming and Scripting
Hi
Following is an example line.
echo "192.22.22.22 \"33dffwef\" 200 300 dsdsd" | sed "s:\(\ *\ \):\1:"
I want it's output to be
200
However this is not the case. Can you tell me how to do it? I don't want to use AWK for this. Secondly, how can i fetch just 300? Should I use "\2"... (3 Replies)
Discussion started by: shahanali
3 Replies
5. Shell Programming and Scripting
Hi,
I have a flat text file consisting of rows (each field separated by '|') from a table. e.g;
NSW|Gulliver Travels|236||5000|BW
This has to be converted to the following format
NSW "Gulliver Travels" 236 5000 BW
No data field has to be left as a blank character so that we have... (6 Replies)
Discussion started by: vharsha
6 Replies
6. Shell Programming and Scripting
Hi There.
I have a file like this .
a nnnn sds
b ssss fdefd
c sdfd dsfd sdfds
...
...
Summary
t1 t2 t3 t4
s1 s2 s3 s4
f1 f2 f3 f4
..
How to use awk to begin process this file from the line that contains "Summary"?
Thanks!
louis (12 Replies)
Discussion started by: javacore
12 Replies
7. Shell Programming and Scripting
Script 1
Pre-requisites
Create a file with x amount of lines in it, the content of your choice.
Write a script that takes two arguments. The first being a line of text, the second being your newly created file. The script should take the first argument and insert it into the very top (the... (3 Replies)
Discussion started by: ali hussain
3 Replies
8. Shell Programming and Scripting
hi,
i have a file
file1 file2
----------- -----------------
aa bbb ccc 111 1111 1111
ddd eee fff 222 3333 4444
ggg hhh... (5 Replies)
Discussion started by: go4desperado
5 Replies
9. Shell Programming and Scripting
Say a directory contains files
1) "file name 1.xxx"
2) "file name2.yyy"
3) etc
Using a cshell script, is there a way to (1)search for all files that contain " " in the filename and then (2)rename the files so that you replace the whiitespace " " with a "_".
First problem I run into is... (6 Replies)
Discussion started by: orlando47
6 Replies
10. Shell Programming and Scripting
Hello,
I was wondering if there was a way to write a script to do the following:
turn a file that contains:
1234 Kevin Smith 12:09 456235
1234 John Robger 12:09:09 353657
into:
1234%Kevin%Smith%12:09%456235... (10 Replies)
Discussion started by: kevin80
10 Replies