Sponsored Content
Full Discussion: Removing lines from a file
Top Forums Shell Programming and Scripting Removing lines from a file Post 93199 by SelectSplat on Friday 16th of December 2005 10:49:00 AM
Old 12-16-2005
It's going to be difficult to parse that many row in any shell script.

Are you not able to load the files into a DB via isql, bcp, or sqlplus?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Removing lines within a file

Hi There, I've written a script that processes a data file on our system. Basically the script reads a post code from a list file, looks in the data file for the first occurrence (using grep) and reads the line number. It then tails the data file, with the line number just read, and outputs to a... (3 Replies)
Discussion started by: tookers
3 Replies

2. UNIX for Dummies Questions & Answers

Removing lines from a file

I'm trying to find a command which will allow me to remove a range of lines (2-4) from a .dat file from the command line without opening the file. Someone mentioned using the ex command? Does anyone have any ideas? thanks (6 Replies)
Discussion started by: computersaysno
6 Replies

3. AIX

Removing the first and last lines in a file

Hi Gurus, I'm a little new to UNIX. How can I do remove the first and last line in a file? Say, supppose I have a file as below: 1DMA 400002BARRIE 401002CALGARY/LETHBRI 402002CARLETON 500001PORTLAND-AUBRN 501001NEW YORK, NY ... (1 Reply)
Discussion started by: naveendronavall
1 Replies

4. Shell Programming and Scripting

Removing the first and last lines in a file

Hi Gurus, I'm a little new to UNIX. How can I do remove the first and last line in a file? Say, supppose I have a file as below: Code: 1DMA 400002BARRIE 401002CALGARY/LETHBRI 402002CARLETON 500001PORTLAND-AUBRN 501001NEW YORK, NY 502001BINGHAMTON, NY ... (2 Replies)
Discussion started by: naveendronavall
2 Replies

5. Shell Programming and Scripting

Removing Lines From a File

Hi Does anybody know of a command that will enable me to remove all entries in a file that have the format (name & time) more testfile anthony 2003 anthonyr 2008 amorel 15:00 anthonyp 14:35 anthonyp 14:35 anthonyr 2008 ardean 13:28 arlene 2003 arlenem 08:15 arlenem 08:15... (5 Replies)
Discussion started by: jamba1
5 Replies

6. Shell Programming and Scripting

removing lines from file

Hi I have many files all with 1 field per line as in 12345 abcde john.paul.net 6789101 how do I remove ceratin lines from these files. Have tried sed but sed wrecks my head! Many thanks in advance for any help (9 Replies)
Discussion started by: rob171171
9 Replies

7. UNIX for Dummies Questions & Answers

removing several lines from a file

Hi folks, I have a long string of DNA sequences, and I need to remove several lines, as well as the line directly following them. For example, here is a sample of my starting material: >548::GY31UMJ02DLYEH rank=0007170 x=1363.5 y=471.0 length=478... (1 Reply)
Discussion started by: kkohl78
1 Replies

8. Shell Programming and Scripting

Removing lines from a file

Hi, I have a linux server that was hacked and I have a bunch of files that sporadically contain the following lines through out the file: <?php eval(base64_decode("Xxxxxxxxxxxxxx/xxxxxxxx")); I did't put the exact lines of the file in this post. The "Xxxx" are random letters/numbers.... (8 Replies)
Discussion started by: nck
8 Replies

9. Shell Programming and Scripting

Removing multiple lines from input file, if multiple lines match a pattern.

GM, I have an issue at work, which requires a simple solution. But, after multiple attempts, I have not been able to hit on the code needed. I am assuming that sed, awk or even perl could do what I need. I have an application that adds extra blank page feeds, for multiple reports, when... (7 Replies)
Discussion started by: jxfish2
7 Replies

10. Shell Programming and Scripting

Removing lines from a file

I have a file `/tmp/wrk` containing filenames with paths. I want to remove filenames from this file, for example remove all filenames containing alja cagr cavt clta cmdo or corl remove all filenames containing data for days in region `d.2016.001` to `d.2016.207` remove all filenames... (10 Replies)
Discussion started by: kristinu
10 Replies
freebcp(1)							 FreeTDS Utilities							freebcp(1)

NAME
freebcp - bulk loading utility for Sybase and Microsoft databases SYNOPSIS
freebcp [[database.]owner.]object_name {in | [query]out} datafile { -c | -n | -f formatfile } [-b batchsize] [-F firstrow] [-L lastrow] [-e errfile] [-I interfaces] [-m maxerrors] [-t field_term] [-r row_term] [-h hints] [-T textsize] [-A packet_size] [-O options] [-S servername] [-U username] [-P password] [-EdVv] DESCRIPTION
freebcp is a utility program distributed with FreeTDS. freebcp replicates (in part at least) the functionality of the "bcp" utility pro- grams distributed by Sybase and Microsoft. freebcp makes use of the db-lib bcp API provided by FreeTDS. This API is also available to application developers. The manual pages or online help for Sybase or SQL Server can be referenced for more detailed information on "bcp" functionality. TABLES AND FILES
database The database of the object being copied. Optional if the table/view is in the default database for username. owner The owner of the object being copied. Optional if username or the database owner is the owner of the table. object_name Usually, object_name is the name of the database table you wish to access. It can also be a view (and, subject to constraints, it is sometimes possible to load a view). It can also be an SQL query, cf. queryout, below. in | [query]out The direction of the bulk copy operation. 'in' indicates data are to be copied from a host file into a database table; 'out' indi- cates data are to be copied from a database table to a host file. 'queryout' indicates that table_name is in fact a query, rather than a database object. freebcp will execute the query and write the results to a file. (It is a good idea to have the query return one and only one result set.) datafile The name of an operating system file. OPTIONS
-c The host data file is (or will be) in "character" format, i.e., a text file. Encoding is determined by the client charset attribute in freetds.conf. -n The host data file is in "native" format. This is a format that freebcp will be able to process, but is not portable or readable. -f formatfile The format of the host data file is described by formatfile. The layout of formatfile is identical to that understood by the Sybase and Microsoft bcp utilities, but is too complicated to describe here. -b batchsize The number of rows per batch of data copied. Batching applies only when you are bulk copying into the database. Each batch of data is effectively 'committed' into the database. The default value for batchsize is 1000. -F firstrow The first row to copy from the input file or database table. The default is the first row, row 1. -L lastrow The last row to copy from an input file or database table. The default is the last row. -r row_term The row terminator for a character file. May be more than one character. Default is newline (' '). Cf. -c, above. -t field_term The field terminator for character file. Also known as a column delimiter. May be more than one character. Default is tab (' '). Cf. -c, above. -m maxerrors Stop after encountering maxerror errors. Default 10. -e errfile Write errors to error_file. For uploads. Includes line and column information, and the row data. -S servername The name of the Database Server to which to connect. -U username A database login name. If username is not provided, a domain login is attempted for TDS 7+ connections. -P password A database password. -E Write the data in datafile to the table's IDENTITY column. Without this flag, the identity data present in the datafile will be ignored, and new IDENTITY values will be generated for the imported rows. -d Turn off any logging. (Unintuitive, perhaps.) -O options SQL text to set connection options prior to the bcp operation. If options is a valid filename, the SQL is read from the file instead. Sometimes needed for queryout. Example: "-O 'SET QUOTED_IDENTIFIER ON'" -I interfaces The name and location of the interfaces file to search when connecting to servername. Overrides freetds.conf. -h hints Set bcp hints. For valid values, cf. bcp_options() in the FreeTDS Reference Manual. -T textsize For text or image columns, set the maximum number of characters to request from the server. Defaults to the setting in freetds.conf. If not specified anywhere, defaults to the full size of the data. -A packet_size Set the size of a TDS packet to packet_size. Not sure why you would want to do this, except as an experiment. -v -V Print the version information and exit. ENVIRONMENT
DSQUERY default servername NOTES
When connecting to a Sybase database server, it is required that the TDS 5.0 protocol be used. When connecting to a Microsoft SQL Server 2000 database server, the TDS 7.1 protocol is required. Theoretically both Sybase and Microsoft support the TDS 4.2 protocol, but in reality they implement the bcp portion of TDS 4.2 differently. FreeTDS has no way of knowing which type of server it's connected to, hence TDS protocol 4.2 is not supported. HISTORY
freebcp first appeared in FreeTDS 0.60 AUTHORS
The freebcp utility was written by Bill Thompson (thompbil@exchange.uk.ml.com) BUGS
Currently, there is no support for text data types in freebcp, when SQL Server 2000 is the target database. doc 13 November 2011 freebcp(1)
All times are GMT -4. The time now is 03:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy