10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello, I'm trying to take information from a list of hundreds of subject ids (where each line is a new subject id), and insert each line into a new text file that contains the pathnames for each subject.
To clarify, all subject have a similiar path name (e.g., C:\data\SUBJECT_ID\) that contains... (4 Replies)
Discussion started by: invisibledwarf
4 Replies
2. Shell Programming and Scripting
I need to insert text from one file into another file after specific term. I guess sed is the best method of doing this and I can insert a specified text string using this script but I am not sure how to modify it to insert text from another file:
#!/bin/sh
sed 's/\<VirtualHost... (17 Replies)
Discussion started by: barrydocks
17 Replies
3. Shell Programming and Scripting
Hi,
I have a file which looks like this:
A 01 00
B 02 00
C 04 00
D 00 01
E 01 01
F 02 01
G 01 04
H 02 04
I want to insert some text if the field if the last column changes. It should look like this:
Value 00
A 01 00
B 02 00
C 04 00
Value 01 (6 Replies)
Discussion started by: wenclu
6 Replies
4. Shell Programming and Scripting
Hi all,
I want to create a file and then insert some text into it. I'm trying to create a .sh script that will create a new python file from a template.
Can someone tell me why this won't work,
touch $1 | sed -e '1i\Some test code here'
Sorry I'm quite new to all this!
Just as a side... (3 Replies)
Discussion started by: ahodgson
3 Replies
5. UNIX for Dummies Questions & Answers
Hi, been searching Google for like an hour and I doubt I got the right keywords so might as well ask here.
What I need:
Before:
Article1.txt 564
Article2.txt 799
Article3.txt 349
Article4.txt 452
* Separate files over 400 wordcount *
After:
Article1.txt 564... (3 Replies)
Discussion started by: Richard2000
3 Replies
6. Shell Programming and Scripting
I'm having a problem how to find the specific word in a file without using the word itself as a search but using the assigned variable which is the $passwd.. what command should I use to find the value of $passwd written in different script? how do I use the command to print the value in this... (7 Replies)
Discussion started by: jenimesh19
7 Replies
7. Shell Programming and Scripting
Hi guys,
I need to insert @test.com after each entry in my .txt file.
1
2
3
4
1@test.com
2@test.com
3@test.com
4@test.com
Tried to use
cat test.txt |sed 's/$/@test.com/'but it does this instead:
1
@test.com
2 (6 Replies)
Discussion started by: spirm8
6 Replies
8. Shell Programming and Scripting
Hey,
I have 10 lines of text ... And I would like to Insert prefix for each line with static text.
perl -pi -e 's/()/$1 TEST$./' data.txt
Each line will have different static prefix, Code above works perfectly for 1st line ... I'm just not sure how I can run same command for 2nd line 3rd... (4 Replies)
Discussion started by: NDxiak
4 Replies
9. Shell Programming and Scripting
I am in a dire need of doing this job , please help from shell script or perl script. It will be highly appreciated.
Please have a look at the following INPUT file;
The first 14 rows are not of interest but I want them to be included in the output file as they are. From the row 14... (3 Replies)
Discussion started by: digipak
3 Replies
10. Shell Programming and Scripting
Greetings.
I am struggling with a shell script to make my life simpler, with a number of practical ways in which it could be used. I want to take a standard text file, and pull the 'n'th word from each line such as the first word from a text file.
I'm struggling to see how each line can be... (5 Replies)
Discussion started by: tricky
5 Replies