Visit The New, Modern Unix Linux Community

Top Forums UNIX for Dummies Questions & Answers Large file data handling issue Post 302731615 by binlib on Thursday 15th of November 2012 12:39:21 PM
So the file has no line feed, you just want to get rid of the last byte. If you have gnu "head" you can do
Code:
head -c size-1 inputfile > outputfile

Or you can use dd to truncate the file in place (make backup if you need):
Code:
dd if=/dev/null of=inputfile bs=1 count=1 seek=size-1

Of course dd can do "head -c" too:
Code:
dd if=inputfile of=outputfile bs=size-1 count=1

If your input had line feed, you could truncate to size-2 and then append a line feed to it.
 
Test Your Knowledge in Computers #240
Difficulty: Easy
In 1973, a transatlantic satellite link connected the Norwegian Seismic Array (NORSAR) to the ARPANET, making Norway the first country outside the US to be connected to the network.
True or False?

10 More Discussions You Might Find Interesting

1. HP-UX

Need to split a large data file using a Unix script

Greetings all: I am still new to Unix environment and I need help with the following requirement. I have a large sequential file sorted on a field (say store#) that is being split into several smaller files, one for each store. That means if there are 500 stores, there will be 500 files. This... (1 Reply)
Discussion started by: SAIK
1 Replies

2. Shell Programming and Scripting

Performance issue in UNIX while generating .dat file from large text file

Hello Gurus, We are facing some performance issue in UNIX. If someone had faced such kind of issue in past please provide your suggestions on this . Problem Definition: /Few of load processes of our Finance Application are facing issue in UNIX when they uses a shell script having below... (19 Replies)
Discussion started by: KRAMA
19 Replies

3. Shell Programming and Scripting

Extract data from large file 80+ million records

Hello, I have got one file with more than 120+ million records(35 GB in size). I have to extract some relevant data from file based on some parameter and generate other output file. What will be the besat and fastest way to extract the ne file. sample file format :--... (2 Replies)
Discussion started by: learner16s
2 Replies

4. Shell Programming and Scripting

UNIX File handling -Issue in reading a file

I have been doing automation of daily check activity for a server, i have been using sqls to retrive the data and while loop for reading the data from the file for several activities. BUT i got a show stopper the below one.. where the data is getting store in $temp_file, but not being read by while... (1 Reply)
Discussion started by: KuldeepSinghTCS
1 Replies

5. Shell Programming and Scripting

Severe performance issue while 'grep'ing on large volume of data

Background ------------- The Unix flavor can be any amongst Solaris, AIX, HP-UX and Linux. I have below 2 flat files. File-1 ------ Contains 50,000 rows with 2 fields in each row, separated by pipe. Row structure is like Object_Id|Object_Name, as following: 111|XXX 222|YYY 333|ZZZ ... (6 Replies)
Discussion started by: Souvik
6 Replies

6. Red Hat

Advice regarding filesystems handling large number of files

Hi All, I have a CentOS operating system installed. I work with really huge number of files which are not only huge in number but some of them really huge in size. Minimum number of files could be 1 million to 2 million in one directory itself. Some of the files are even several Gigabytes in... (2 Replies)
Discussion started by: shoaibjameel123
2 Replies

7. Shell Programming and Scripting

UNIX file handling issue

I have a huge file semicolon( ; ) separated records are Pipe(|) delimited. e.g abc;def;ghi|jkl;mno;pqr|123;456;789 I need to replace the 50th field(semicolon separated) of each record with 9006. The 50th field can have no value e.g. ;; Can someone help me with the appropriate command. (3 Replies)
Discussion started by: Gurkamal83
3 Replies

8. UNIX for Dummies Questions & Answers

File handling issue

Hi All, I am running into an issue. I have a very big file. Wants to split it in smaller chunks. This file has multiple header/ trailers. Also, between each header/trailer there are records. Number of records in each header trailer combination can vary. Also, headers can start with... (3 Replies)
Discussion started by: Gurkamal83
3 Replies

9. Shell Programming and Scripting

Output large volume of data to CSV file

I have a program that output the ownership and permission on each directory and file on the server to a csv file. I am getting error message when I run the program. The program is not outputting to the csv file. Error: the file access permissions do not allow the specified action cannot... (2 Replies)
Discussion started by: dellanicholson
2 Replies

10. Shell Programming and Scripting

Large File masking incorrectly happening delimeter issue

The OS version is Red Hat Enterprise Linux Server release 6.10 I have a script to mask some columns with **** in a data file which is delimeted with , I am using awk for the masking , when I try to mask a small file the awk works fine and masks the required column , but when the file is... (6 Replies)
Discussion started by: LinuxUser8092
6 Replies
UilDumpSymbolTable(3X)													    UilDumpSymbolTable(3X)

NAME
UilDumpSymbolTable - Dumps the contents of a named UIL symbol table to standard output SYNOPSIS
#include <uil/UilDef.h> void UilDumpSymbolTable (root_ptr) sym_entry_type *root_ptr; DESCRIPTION
The UilDumpSymbolTable function dumps the contents of a UIL symbol table pointer to standard output. Specifies a pointer to the symbol ta- ble root entry. This value can be taken from the parse_tree_root part of the Uil_compile_desc_type data structure returned by Uil. By following the link from the root entry, you can traverse the entire parse tree. Symbol table entries are in the following format: hex.address symbol.type symbol.data prev.source.position source.position modification.record where: Specifies the hexadecimal address of this entry in the symbol table. Specifies the type of this symbol table entry. Some possible types are root, module, value, procedure, and widget. Specifies data for the symbol table entry. The data varies with the type of the entry. Often it contains pointers to other symbol table entries, or the actual data for the data type. Specifies the end point in the source code for the previous source item. Specifies the range of positions in the source code for this symbol. The exact data structures for each symbol type are defined in the include file <UilSymDef.h>. Note that this file is automatically included when an application includes the file <UilDef.h>. SEE ALSO
Uil(3X) UilDumpSymbolTable(3X)

Featured Tech Videos

All times are GMT -4. The time now is 10:08 AM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy