Sponsored Content
Top Forums Shell Programming and Scripting Place variables at the beginning of each line Post 302471933 by GoldenFire on Monday 15th of November 2010 04:25:17 PM
Old 11-15-2010
Thank you so very much everybody.

All the codes suggested by ctsgnb are working flawlessly. Great work!

I tested the two codes by danmero and Franklin52 and nothing is changed in my file. I got no error but it just returned the original file back to me.

I have not tested the code by DGPickett yet. I am a newbie and I need more time to figure out what should I do with these lines! I will surely test it later today.

You guys are awesome. Thanks again!

Last edited by GoldenFire; 11-15-2010 at 05:31 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Unix Script with line number at beginning of each line.

Could anybody help me. I need to create a script that reads a text file from STDIN and prints out the file to STDOUT with line numbers at the beginning of each line. Thanks. (5 Replies)
Discussion started by: mascorro
5 Replies

2. Shell Programming and Scripting

Getting the value of a line, that changes place

Hi I am trying to get the value of several results in a file called seq032.diag. The values I am looking for is down under Smooth Tracking nodes and is for g01r01 g02r01 s01t02 etc etc. The problem is that when I try to use look for text and tail etc, it works fine in one result file. In... (1 Reply)
Discussion started by: Navigatorchief
1 Replies

3. Shell Programming and Scripting

SED command help: Can we pass predefined variables in place of regex

Hi All, I have a doubt. Can we assign a regular expression for pattern searching to a variable in a script and then use that variable in place of a regular expression in sed command.I tried but got some syntax error!!Is it not possible.Because my requirement is that i have a generic script to get... (8 Replies)
Discussion started by: usha rao
8 Replies

4. Shell Programming and Scripting

Using NR with two variables at the beginning of awk

hi My requirement is this: I have a file having around 100000 records pipe delimited. Now I want to compare record 1 with record 2 and similarly record3 with record 4, this goes on.. For this purpose i put a script as follows: #!bin/ksh ct_line=1 nxt_line=`expr ${ct_line} + 1` awk -F "|"... (1 Reply)
Discussion started by: ramkrix
1 Replies

5. Shell Programming and Scripting

Space at beginning of the line

How can I delete spaces at the begining of all lines of my file ? (2 Replies)
Discussion started by: Sara_84
2 Replies

6. UNIX for Dummies Questions & Answers

How to specify beginning-of-line/end-of-line characters inside a regex range

How can I specify special meaning characters like ^ or $ inside a regex range. e.g Suppose I want to search for a string that either starts with '|' character or begins with start-of-line character. I tried the following but it does not work: sed 's/\(\)/<do something here>/g' file1 ... (3 Replies)
Discussion started by: jawsnnn
3 Replies

7. UNIX for Dummies Questions & Answers

vim copy line and paste at the beginning, middle, and end of another line

How would you do vim copy line and paste at the beginning, middle, and end of another line. I know yy copies the whole line and p pastes the whole line, but on its own separate line. Sometimes I would like to copy a line to the beginning, middle, or end of another line. I would think this would be... (3 Replies)
Discussion started by: cokedude
3 Replies

8. Shell Programming and Scripting

comment a line of the patterns is a the beginning of the line

I need to comment the lines starting with pattern "exclude" or "exclude=". If the work exclude comes at any other part, ignore it. Also, ignore, excludes, excluded etc. Ie only comment the line starting with exclude. File contents. exclude exclude= hi I am excluded excludes excludes= ... (9 Replies)
Discussion started by: anil510
9 Replies

9. Shell Programming and Scripting

beginning less from line #

Hi from a script i want to to read a file beginning at line e.g. number 21 to the EOF. less +n21 temp.txt Bevor the result, it brings an empty page, so that i cant use for scripting. Any idea how the problem can be solved? Thanks in advance! IMPe (2 Replies)
Discussion started by: IMPe
2 Replies

10. Red Hat

Remove new line for a particular place

Hello All, I have a text file which gets uploaded to tables using shells script. However before running that script I need to alter it, like in the below I have to firstly find the word 1234 and remove the new line from end of it. 1234,5678,fasfasasfsadf abc changes to... (11 Replies)
Discussion started by: Sandeep_sandy
11 Replies
TASKS(3)                                                User Contributed Perl Documentation                                               TASKS(3)

NAME
TASKS - Want to help? These things need doing... Increase test coverage More tests need to be added to test the codes that not urrently being tested. It's pretty poor right now: http://pjcj.sytes.net/cover/latest/DBI-1.52/coverage.html Start with improving the subroutine coverage http://pjcj.sytes.net/cover/latest/DBI-1.52/blib-lib-DBI-pm--subroutine.html Test the proxy The current t/80proxy.t is isolated from the rest of the test suite so actually tests very little, and what it does test is duplicating other tests. Ideally the proxy should be tested in the same way as DBI::PurePerl. In other words, by creating wrappers test files for each test file that set $ENV{DBI_AUTOPROXY} and run the original test. They'll also need to start and stop a proxy server. Fixing bugs The official bug list is here: http://rt.cpan.org/NoAuth/Bugs.html?Dist=DBI Naturally I'll offer direction and guidance on any you want to tackle. I've also got a few that could be entered into rt.cpan.org. Others General: Protect trace_msg from SIGPIPE? prepare(...,{ Err=>my $isolated_err, ...}) Add trace module that just records the last N trace messages into an array and prepends them to any error message to provide context for the error. Document DBI_PROFILE_FLOCK and LockFile attrib in DBI::ProfileData and DBI::ProfileDumper Performance: Move _new_sth to DBI::db::_new_sth (leave alias) and implement in C Or call _new_child and move to DBI::common? Implement FETCH_many() in C Add high-res dbi_time for windows - via Time::HiRes glob replace dbi_time()? perl v5.12.1 2009-06-08 TASKS(3)
All times are GMT -4. The time now is 03:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy