How to input text on every 2nd line?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to input text on every 2nd line?
# 8  
Old 04-06-2010
Quote:
Originally Posted by alister
Welcome to the forums, grepfruit (love the nick Smilie).

If you look at the sample data provided, you'll see that the inserted text precedes each line. That is not an append.

Regards,
Alister
Oh, sorry sorry. Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Search last column of INPUT.txt in TABLEs text and add correspond columns to INPUT.txt

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)
Discussion started by: alii
2 Replies

2. UNIX for Dummies Questions & Answers

Search String, Out matched text and input text for no match.

I need to search a string for some specific text which is no big deal using grep. My problem is when the search fails to find the text. I need to add text like "na" when my search does not match. I have tried this command but it does not work when I put the command in a loop in a bash script: ... (12 Replies)
Discussion started by: jojojmac5
12 Replies

3. Shell Programming and Scripting

How to read file line by line and compare subset of 1st line with 2nd?

Hi all, I have a log file say Test.log that gets updated continuously and it has data in pipe separated format. A sample log file would look like: <date1>|<data1>|<url1>|<result1> <date2>|<data2>|<url2>|<result2> <date3>|<data3>|<url3>|<result3> <date4>|<data4>|<url4>|<result4> What I... (3 Replies)
Discussion started by: pat_pramod
3 Replies

4. Shell Programming and Scripting

Deleting text start at 2nd line....

How can I delete the first '2' characters in the 2nd line and every fourth line thereafter (Means line no.s 2, 6, 10...so on). For example if the following is my Input treieieiei trrpepepepep tyeueueue tyeueueeu tyeyeyeye tryryry tyeyey tyrtyty tytyty tututu tututututu Output... (8 Replies)
Discussion started by: cs_novice
8 Replies

5. Shell Programming and Scripting

Curl - input line by line from text file

Hi, I've got a text file with hundreds of lines I need to upload to an API via curl, one by one. The text file is like: 2012-08-01 10:45,124 2012-08-02 10:45,132 2012-08-03 10:45,114 I want to get curl to go through the text file sending a post for each line. like: curl --request... (0 Replies)
Discussion started by: emdeex
0 Replies

6. UNIX for Dummies Questions & Answers

How to read a line of text from user input?

Hiii I wanna a read a line of text from standard input. The user enter data like this way name phone_no month1_salary month2_salary that is user enter the name ,phone no and salary of 2 months in a single line by giving spaces. I wanna add the 3rd and 4th fields ...ie add both... (4 Replies)
Discussion started by: krishnampkkm
4 Replies

7. Shell Programming and Scripting

print line if 2nd field exists in text

2 files, first one has 3 fields seperated by ||| and 2nd one is plain text. I want to copy the lines from the first file if the 2nd field is present anywhere in the text file. This is what I've tried, but I'm new to awk and shell scripting in general so it's kinda broken. #!/bin/awk -f BEGIN... (15 Replies)
Discussion started by: FrancoisCN
15 Replies

8. UNIX for Dummies Questions & Answers

add new lines of text before and after each input line

I have a file that contains hundreds of lines such as: this_is_macro,000001 this_is_macro,000002 this_is_macro,000003 I would like to add the variable words MACROBEGIN MACRO_000001 MACROBEGIN MACRO_000002 MACROBEGIN MACRO_000003 above each line and add the word MACROEND ... (2 Replies)
Discussion started by: kenneth.mcbride
2 Replies

9. Shell Programming and Scripting

How to print the lines after 2nd line from text file

Hi All, I need to print the lines after 2nd line irrespective of the number of lines in file if the file contents are like below ---------- root:!:0:0::/root:/usr/bin/ksh daemon:!:1:1::/etc: bin:!:2:2::/bin: sys:!:3:3::/usr/sys: adm:!:4:4::/var/adm: uucp:!:5:5::/usr/lib/uucp:... (6 Replies)
Discussion started by: ram1729
6 Replies

10. Shell Programming and Scripting

How to prompt for input & accept input in ONE line

hi, am a new learner to shell programming. i have a script which will prompt for user to key in their name & display their name afterwards. script ===== echo "Pls enter your name:" read name echo "Your name is $name." output ===== Pls enter your name: Bob Your name is Bob. what... (2 Replies)
Discussion started by: newbie168
2 Replies
Login or Register to Ask a Question
BYTEPREFIX(5)							File Formats Manual						     BYTEPREFIX(5)

NAME
byteprefix - Configuration for display of sizes DESCRIPTION
There are two standard ways to use units in computing: base 10 (1 k = 10^3 = 1 000) and base 2 (1 K = 2^10 = 1 024). Historically, most computer programs have used units in base 2, where 1 KB = 1 024 bytes, 1 MB = 1 048 576 bytes, etc. However, users are more likely to expect and understand sizes in base 10, as this is the norm outside of computing. This configuration file is a method for configuring programs (that use libkibi) to display sizes in the user's preferred style. It can be configured through a configuration file or environment variable (which takes precedence). When not using the "historic" style, IEC-style prefixes (KiB, MiB, etc.) are used for base 2 units, to disambiguate them from base 10 units (kB, MB, etc.). OPTIONS
There are three possible styles (Default: base10): base2 Display all sizes in Base 2 with IEC prefixes. 1 KiB = 1 024 bytes. 1 MiB = 1 024 KiB = 1 048 576 bytes. 1 GiB = 1 024 MiB = 1 048 576 KiB = 1 073 741 824 bytes. base10 Display all sizes in Base 10, except for sizes of RAM, which use base 2 with IEC prefixes. Everything except RAM: 1 kB = 1 000 bytes. 1 MB = 1 000 kB = 1 000 000 bytes. 1 GB = 1 000 MB = 1 000 000 kB = 1 000 000 000 bytes. RAM: 1 KiB = 1 024 bytes. 1 MiB = 1 024 KiB = 1 048 576 bytes. 1 GiB = 1 024 MiB = 1 048 576 KiB = 1 073 741 824 bytes. historic Display all sizes in Base 2, without IEC prefixes. 1 KB = 1 024 bytes. 1 MB = 1 024 KB = 1 048 576 bytes. 1 GB = 1 024 MB = 1 048 576 KB = 1 073 741 824 bytes. Not recommended. This style uses base units 2 with prefixes usually associated with base 10 units. While it uses KB rather than the SI (base 10) kB, there is no such distinction beyond the kilobyte range, and the units are ambiguous. ENVIRONMENT
BYTEPREFIX This environment variable will override the configured or default style. It should just contain one of the style names, listed in OPTIONS above. XDG_CONFIG_HOME The location of the user's configuration files. If not set, it will be assumed to be ~/.config. FILES
The preferred style can be set in a system-wide configuration file and/or in user's own configuration file (which will take precedence). If no configuration file exists, the default style is base10. /etc/byteprefix or XDG_CONFIG_HOME/byteprefix This file should contain a single line: format=style. Lines beginning with # are treated as comments. EXAMPLE
A user wanting base 2 display can set the following in ~/.config/byteprefix: format=base2 SEE ALSO
units(7) libkibi January 2011 BYTEPREFIX(5)