10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hello,
I try to add users from a text file with this form:
username:groupename:homedir
first i extract data which is separated by ":"
then i use useradd to add users/groups.
but,,, my code doesn't works :
#!/bin/bash
echo "give me a text file: "
read dir
# control if... (2 Replies)
Discussion started by: ref012
2 Replies
2. 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
3. Shell Programming and Scripting
I have a tab delimited text file,
id name distance
1 3325167 0.334561754018
2 3290488 0.389444269458
3 3288794 0.392312701782
4 3347602 0.392532202097
5 3295355 0.394394169485
I need to add a line after the header line. The first and third field of... (3 Replies)
Discussion started by: LMHmedchem
3 Replies
4. Shell Programming and Scripting
Hello,
I after some assistance please. Below is a file I need to read and for each line write an output.
My input file looks like this
2 20008 2003-08-26
2 20032 2003-08-26
2 20041 2003-08-26
2 20037 2003-08-26
2 20050 2003-08-26
6 ... (6 Replies)
Discussion started by: giles.cardew
6 Replies
5. Shell Programming and Scripting
I am attempting to insert multiple lines of text into a specific place in a text file based on the lines above or below it.
For example, Here is a portion of a zone file.
IN NS ns1.domain.tld.
IN NS ns2.domain.tld.
IN ... (2 Replies)
Discussion started by: cdn_humbucker
2 Replies
6. Shell Programming and Scripting
Hi I am trying to write a bash script to add a line of text to the middle of a file.
The way I worked it out was to calculate the number of lines and divide by 2. The file I am using is called newfile and it just contains lines of data.
The new file I have created I have called midfile and... (7 Replies)
Discussion started by: BundBash
7 Replies
7. Shell Programming and Scripting
Im writing a KSH script to read a simple text file and add a delimiter. Ive written the following script but it runs very slow. I initially used the cut command to substring the input record then switched to this version using awk to substring... both run too slow. Any ideas how to make this more... (2 Replies)
Discussion started by: lock
2 Replies
8. Shell Programming and Scripting
Hi,
I wanted to add specific text to each row in a text file containing three rows. Example:
0 8 7 6 5 5
7 8 9 0 7 9
7 8 9 0 1 2
And I want to add a 21 at the beginning of the first row, and blank spaces at the beginning of the second two rows. To get this:
21 0 8 7 6 5 5
7 8... (4 Replies)
Discussion started by: hertingm
4 Replies
9. Shell Programming and Scripting
Suppose content of my first file:
first line
second line
third line
How can i insert text between "first line" & "second Iline"
Any help?????/ (7 Replies)
Discussion started by: bishweshwar
7 Replies
10. Shell Programming and Scripting
How would I add text to the beginning of each line in a text file in a script right after the file is created from another text file. (4 Replies)
Discussion started by: cubs0729
4 Replies