Sponsored Content
Full Discussion: Additonal Line in Text File
Top Forums UNIX for Dummies Questions & Answers Additonal Line in Text File Post 302581540 by theref on Tuesday 13th of December 2011 10:50:24 AM
Old 12-13-2011
Additonal Line in Text File

I have a text file that is generated each morning and 9/10 runs perfectly. However, every now and again it fails and it is a nightmare to find the line that is corrupt as this job fails in the early hours when I am usually in a deep sleep.

The file is made up of a header record, a trailer record and in between 2 order lines which are in pairs.

For example...

Header - Starts with a 1
Order Line - Starts with a 2 [pair 1]
Order Line - Starts with a 3 [pair 2]
Trailer - Starts with a 4

The pattern in the file is therefore, 1,2/3, 2/3, 2/3, 2/3, 2/3,..................4

However occasionally we get an additional line starting with a 3 so we get....

1,2/3, 2/3, 2/3, 2/3,3, 2/3,..................4

I need to find an easy way to find out which line has the additional 3 record.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Adding specific text and spaces to each line in a text file

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

2. Shell Programming and Scripting

How to insert some constant text at beginig of each line within a text file.

Dear Folks :), I am new to UNIX scripting and I do not know how can I insert some text in the first column of a UNIX text file at command promtp. I can do this in vi editor by using this command :g/^/s//BBB_ e,g I have a file named as Test.dat and it containins below text: michal... (4 Replies)
Discussion started by: Muhammad Afzal
4 Replies

3. Shell Programming and Scripting

Search text from a file and print text and one previous line too

Hi, Please let me know how to find text and print text and its previous line. Please don't get irritated few days back I asked text and next line. I am using HP-UX 11.11 Thanks for your help. (6 Replies)
Discussion started by: kamranjalal
6 Replies

4. Shell Programming and Scripting

get the fifth line of a text file into a shell script and trim the line to extract a WORD

FOLKS , i have a text file that is generated automatically of an another korn shell script, i want to bring in the fifth line of the text file in to my korn shell script and look for a particular word in the line . Can you all share some thoughts on this one. thanks... Venu (3 Replies)
Discussion started by: venu
3 Replies

5. Shell Programming and Scripting

Shell script to read a text file line by line & process it...

Hi , I am trying to write an shell, which reads a text file (from a location) having a list of numbers of strictly 5 digits only ex: 33144 Now my script will check : 1) that each entry is only 5 digits & numeric only, no alphabets, & its not empty. 2)then it executes a shell script called... (8 Replies)
Discussion started by: new_to_shell
8 Replies

6. Shell Programming and Scripting

PERL or SHELL Scrript to search in Directories by taking line by line from a text file

Unix box server version *********** >uname -r B.11.00 >echo $SHELL /usr/bin/ksh --> in this server, I have the path like /IMbuild/dev/im0serv1 ---> in that directory I have the folders startup(.jsp files nearly 100 jsp's ) and scripts(contains .js files nearly 100 files) ... (9 Replies)
Discussion started by: pasam
9 Replies

7. UNIX for Dummies Questions & Answers

Extracting lines from a text file based on another text file with line numbers

Hi, I am trying to extract lines from a text file given a text file containing line numbers to be extracted from the first file. How do I go about doing this? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies

8. Shell Programming and Scripting

Reading text file, comparing a value in a line, and placing only part of the line in a variable?

I need some help. I would like to read in a text file. Take a variable such as ROW-D-01, compare it to what's in one line in the text file such as PROD/VM/ROW-D-01 and only input PROD/VM into a variable without the /ROW-D-01. Is this possible? any help is appreciated. (2 Replies)
Discussion started by: xChristopher
2 Replies

9. Shell Programming and Scripting

How to read a text file line by line and insert into a database table?

I have a test file that I want to read and insert only certain lines into the the table based on a filter. 1. Rread the log file 12 Hours back Getdate() -12 Hours 2. Extract the following information on for lines that say "DUMP is complete" A. Date B. Database Name C.... (2 Replies)
Discussion started by: JolietJake
2 Replies

10. Shell Programming and Scripting

Shell script UNIX to read text file line by line

i have a text file as belows, it includes 2 columns, 1st is the column name, 2nd is the file_name data_file.txt column_name file_name col1 file1 col2 file2 col3 file1 col4 file1 col5 file2 now, i would like to... (4 Replies)
Discussion started by: tester111
4 Replies
ooffice(1)							   User Commands							ooffice(1)

Name
       ooffice - OpenOffice.org office suite

SYNOPSIS
ooffice [-accept=accept-string] [-base] [-calc] [-display display] [-draw] [-global] [-headless] [-help|-h|-?] [-impress] [-invisible] [-math] [-minimized] [-n filename] [-nodefault] [-nolockcheck] [-nologo] [-norestore] [-o filename] [-p filename...] [-pt printername filename...] [-show presentation] [-unaccept=accept-string] [-terminate_after_init] [-view filename] [-web] [-writer] [filename...] oobase oocalc oodraw oofromtemplate ooimpress oomath ooweb oowriter DESCRIPTION
OpenOffice.org is a fully featured office suite for the daily use with all features you would normally expect in a office suite. This script runs OpenOffice with the arguments <args> given on the command line. There are also some wrapper scripts in /usr/bin which run the wanted OpenOffice.org module. OPTIONS
filename... Files to operate on. Opening them is the default behavior, which can be influenced by command line arguments. -p will print the files instead. -accept=accept-string Notifies the OpenOffice.org software that upon the creation of "UNO Acceptor Threads", a "UNO Accept String" will be used. -base Starts with the database wizard. -calc Starts with an empty Calc document. -display display This option specifies the X server to contact; see X(7) -draw Starts with an empty Draw document. -global Starts with an empty Global document. -headless Starts in "headless mode", which allows using the application without user interface. This special mode can be used when the application is controlled by external clients via the API. -help|-h|-? Lists the available OOo-native command line parameters to the console. -impress Starts with an empty Impress document. -invisible Starts in invisible mode. Neither the start-up logo nor the initial program window will be visible. However, the OpenOffice.org software can be controlled and documents and dialogs opened via the API. When the OpenOffice.org software has been started with this parameter, it can only be ended using the taskmanager (Windows) or the kill command (UNIX based systems). It cannot be used in conjunction with -quickstart. -math Starts with an empty Math document. -minimized Keep the splash screen minimized. -n filename Creates a new document using filename as a template. -nodefault Starts the application without any window opened for the first time. A window appears if you start the office next time. It is used together with the option -nologo by quickstarters. Note that the option -quickstart has not been longer supported since OpenOffice.org 2.0.0. -nolockcheck Disables the check for remote instances using the installation. -nologo Disables the splash screen at program start. -norestore Disables restart and file recovery after a system crash. It is possible OOo will try to restore a file it keeps crashing on, if that happens -norestore is the only way to start OOo. -o filename Opens filename for editing, even if it is a template. -p filename... Prints the given files to the default printer and ends. The splash screen does not appear. If the file name contains spaces, then it must be enclosed in quotation marks. -pt printername filename... Prints the given files to the printer printername and ends. The splash screen does not appear. If the file name contains spaces, then it must be enclosed in quotation marks. -show presentation Starts with the given Impress file and starts the presentation. Enters edit mode after the presentation. -unaccept=accept-string Closes an acceptor that was created with -accept option. Use -unaccept=all to close all open acceptors. -terminate_after_init The office terminates after it registers some UNO services. The office doesn't show the intro bitmap during startup. -view filename Creates a temporary copy of the given file and opens it read-only. -web Starts with an empty HTML document. -writer Starts with an empty Writer document. TROUBLESHOOTING PROBLEMS
See http://en.opensuse.org/Bugs:OOo for more details about how to report bugs in OpenOffice.org. SEE ALSO
http://go-oo.org/ AUTHOR
This manual page was created by Rene Engelhard <rene@debian.org> for the Debian GNU/Linux Distribution, because the original package does not have one. It was updated for Novell by Petr Mladek <petr.mladek@novell.com>. OpenOffice.org 2008-11-19 ooffice(1)
All times are GMT -4. The time now is 11:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy