10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi everyone :)
I have a file "words.txt" containing hundreds of lines of text. Each line contains a slogan.
Using the code below i am able to generate an image with the slogan text from each line.
The image filename is saved matching the last word on each line.
Example:
Line 1: We do... (2 Replies)
Discussion started by: martinsmith
2 Replies
2. Shell Programming and Scripting
Platform : Oracle Linux 6.8
Shell : bash
I have a file which has lines like below. These are SELECT queries (SQL)
In each line, I want the word just after FROM keyword to be copied and printed on the top along with the word PROMPT.
The words after FROM clause below are table names. So, they... (6 Replies)
Discussion started by: John K
6 Replies
3. Shell Programming and Scripting
I have a text file that has data like:
Data "12345#22"
Fred
ID 12345
Age 45
Wilma
Dino
Data "123#22"
Tarzan
ID 123
Age 33
Jane
I need to figure out a way of adding 1,000,000 to the specific lines (always same format) in the file, so it becomes:
Data "1012345#22"
Fred
ID... (16 Replies)
Discussion started by: say170
16 Replies
4. Shell Programming and Scripting
Dear All,
i am having text file below
rama 123 done
raju 456 not done
keshav 123 done
...............
............
i want to add a serial number to this file, the output should be
1 rama 123 done
2 raju 456 not done
3 keshav 123 done
99 ...............
100 ............
... (3 Replies)
Discussion started by: suryanarayana
3 Replies
5. Linux
Hello! All,
Could you please tell me how to get a specific line number from a text file?
For example below,
ABC
DEF ---> Get this line number, return to an variable
GHI
My OS is Linux.
Thank you so much for your help in advance! (3 Replies)
Discussion started by: barryxian
3 Replies
6. Shell Programming and Scripting
Hi
I want to extract certain text between two line numbers like
23234234324 and
54446655567567
How do I do this with a simple sed or awk command?
Thank you.
---------- Post updated at 06:16 PM ---------- Previous update was at 05:55 PM ----------
found it:
sed -n '#1,#2p'... (1 Reply)
Discussion started by: return_user
1 Replies
7. Shell Programming and Scripting
Hello, I need help in appending the line number of each line to the file and also to get the total number of lines. Can somebody please help me.
I have a file say:
abc
def
ccc
ddd
ffff
The output should be:
Instance1=abc
Instance2=def
Instance3=ccc
Instance4=ddd
Instance5=ffff
... (2 Replies)
Discussion started by: chiru_h
2 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I was wondering if there was a way to append something to filenames based on a wildcard. For example, if I have the following files in a directory:
blah1
blah2
blah3
blah4
blah5
I want to rename these all to:
blah1.txt
blah2.txt
blah3.txt
blah4.txt
blah5.txt
Is there a... (4 Replies)
Discussion started by: Djaunl
4 Replies
9. Shell Programming and Scripting
Hi, I am a newb as far as shell scripting and SED goes so bear with me on this one.
I want to basically append to each line in a file a delimiter character and the line's line number e.g
Change the file from :-
aaaaaa
bbbbbb
cccccc
to:-
aaaaaa;1
bbbbbb;2
cccccc;3
I have worked... (4 Replies)
Discussion started by: pjcwhite
4 Replies
10. Shell Programming and Scripting
I'm currently digging for a way to append a line to a text file where each line begins with the word "setmqaut". This is a continuation of my IBM MQSeries backup script I'm working on to make my life a little easier.
What I would like to do is have each line that looks like this:
setmqaut -m... (4 Replies)
Discussion started by: sysera
4 Replies