Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Large file data handling issue Post 302731305 by spacebar on Wednesday 14th of November 2012 07:03:47 PM
Old 11-14-2012
Quote:
Originally Posted by Gurkamal83
I need to actually remove the last | symbol from this file.
Code:
sed -e 's/\|*$//' filename

is working fine for small files. But not working on this big file. The file size is "614077"
What exactly do you mean by "sed is not working on this big file", What messages do you get when you press enter?
Paste the first and last 100 bytes of the file.
Also try it this way:

Code:
sed 's/|$//' filename

 

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
confstr(3C)						   Standard C Library Functions 					       confstr(3C)

NAME
confstr - get configurable variables SYNOPSIS
#include <unistd.h> size_t confstr(int name, char *buf, size_t len); DESCRIPTION
The confstr() function provides a method for applications to get configuration-defined string values. Its use and purpose are similar to the sysconf(3C) function, but it is used where string values rather than numeric values are returned. The name argument represents the system variable to be queried. If len is not 0, and if name has a configuration-defined value, confstr() copies that value into the len-byte buffer pointed to by buf. If the string to be returned is longer than len bytes, including the terminating null, then confstr() truncates the string to len-1 bytes and null-terminates the result. The application can detect that the string was truncated by comparing the value returned by confstr() with len. If len is 0, confstr() still returns the integer value as defined below, but does not return the string. The confstr() function supports the following values for name, defined in <unistd.h>, for both SPARC and x86: _CS_LFS64_CFLAGS If _LFS64_LARGEFILE is defined in <unistd.h>, this value is the set of initial options to be given to the cc and c89 utilities to build an application using the Large File Summit transitional compilation environment (see lfcompile64(5)). _CS_LFS64_LDFLAGS If _LFS64_LARGEFILE is defined in <unistd.h>, this value is the set of final options to be given to the cc and c89 utilities to build an application using the Large File Summit transitional compilation environment (see lfcompile64(5)). _CS_LFS64_LIBS If _LFS64_LARGEFILE is defined in <unistd.h>, this value is the set of libraries to be given to the cc and c89 utilities to build an application using the Large File Summit transitional compilation environment (see lfcompile64(5)). _CS_LFS64_LINTFLAGS If _LFS64_LARGEFILE is defined in <unistd.h>, this value is the set of options to be given to the lint utility to check application source using the Large File Summit transitional compilation environment (see lfcompile64(5)). _CS_LFS_CFLAGS If _LFS_LARGEFILE is defined in <unistd.h>, this value is the set of initial options to be given to the cc and c89 utilities to build an application using the Large File Summit large file compilation environment for 32-bit applications (see lfcompile(5)). _CS_LFS_LDFLAGS If _LFS_LARGEFILE is defined in <unistd.h>, this value is the set of final options to be given to the cc and c89 utilities to build an application using the Large File Summit large file compilation environment for 32-bit applications (see lfcompile(5)). _CS_LFS_LIBS If _LFS_LARGEFILE is defined in <unistd.h>, this value is the set of libraries to be given to the cc and c89 utilities to build an application using the Large File Summit large file compilation environment for 32-bit applications (see lfcompile(5)). _CS_LFS_LINTFLAGS If _LFS_LARGEFILE is defined in <unistd.h>, this value is the set of options to be given to the lint utility to check application source using the Large File Summit large file compilation environment for 32-bit applications (see lfcompile(5)). _CS_PATH If the ISO POSIX.2 standard is supported, this is the value for the PATH environment variable that finds all standard utilities. Oth- erwise the meaning of this value is unspecified. _CS_POSIX_V6_ILP32_OFF32_CFLAGS If sysconf(_SC_V6_ILP32_OFF32) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of initial options to be given to the c99 utility to build an application using a programming model with 32-bit int, long, pointer, and off_t types. _CS_POSIX_V6_ILP32_OFF32_LDFLAGS If sysconf(_SC_V6_ILP32_OFF32) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of final options to be given to the c99 utility to build an application using a programming model with 32-bit int, long, pointer, and off_t types. _CS_POSIX_V6_ILP32_OFF32_LIBS If sysconf(_SC_V6_ILP32_OFF32) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of libraries to be given to the c99 utility to build an application using a programming model with 32-bit int, long, pointer, and off_t types. _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS If sysconf(_SC_V6_ILP32_OFFBIG) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of initial options to be given to the c99 utility to build an application using a programming model with 32-bit int, long, and pointer types, and an off_t type using at least 64 bits. _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS If sysconf(_SC_V6_ILP32_OFFBIG) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of final options to be given to the c99 utility to build an application using a programming model with 32-bit int, long, and pointer types, and an off_t type using at least 64 bits. _CS_POSIX_V6_ILP32_OFFBIG_LIBS If sysconf(_SC_V6_ILP32_OFFBIG) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of libraries to be given to the c99 utility to build an application using a programming model with 32-bit int, long, and pointer types, and an off_t type using at least 64 bits. _CS_POSIX_V6_LP64_OFF64_CFLAGS If sysconf(_SC_V6_LP64_OFF64) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of initial options to be given to the c99 utility to build an application using a programming model with 64-bit int, long, pointer, and off_t types. _CS_POSIX_V6_LP64_OFF64_LDFLAGS If sysconf(_SC_V6_LP64_OFF64) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of final options to be given to the c99 utility to build an application using a programming model with 64-bit int, long, pointer, and off_t types. _CS_POSIX_V6_LP64_OFF64_LIBS If sysconf(_SC_V6_LP64_OFF64) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of libraries to be given to the c99 utility to build an application using a programming model with 64-bit int, long, pointer, and off_t types. _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS If sysconf(_SC_V6_LPBIG_OFFBIG) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of initial options to be given to the c99 utility to build an application using a programming model with an int type using at least 32 bits and long, pointer, and off_t types using at least 64 bits. _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS If sysconf(_SC_V6_LPBIG_OFFBIG) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of final options to be given to the c99 utility to build an application using a programming model with an int type using at least 32 bits and long, pointer, and off_t types using at least 64 bits. _CS_POSIX_V6_LPBIG_OFFBIG_LIBS If sysconf(_SC_V6_LPBIG_OFFBIG) returns -1, the meaning of this value is unspecified. Otherwise, this value is the set of libraries to be given to the c99 utility to build an application using a programming model with an int type using at least 32 bits and long, pointer, and off_t types using at least 64 bits. _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS This value is a <newline>-separated list of names of programming environments supported by the implementation in which the widths of the blksize_t, cc_t, mode_t, nfds_t, pid_t, ptrdiff_t, size_t, speed_t, ssize_t, suseconds_t, tcflag_t, useconds_t, wchar_t, and wint_t types are no greater than the width of type long. _CS_XBS5_ILP32_OFF32_CFLAGS If sysconf(_SC_XBS5_ILP32_OFF32) returns -1 the meaning of this value is unspecified. Otherwise, this value is the set of initial options to be given to the cc and c89 utilities to build an application using a programming model with 32-bit int, long, pointer, and off_t types. _CS_XBS5_ILP32_OFF32_LDFLAGS If sysconf(_SC_XBS5_ILP32_OFF32) returns -1 the meaning of this value is unspecified. Otherwise, this value is the set of final options to be given to the cc and c89 utilities to build an application using a programming model with 32-bit int, long, pointer, and off_t types. _CS_XBS5_ILP32_OFF32_LIBS If sysconf(_SC_XBS5_ILP32_OFF32) returns -1 the meaning of this value is unspecified. Otherwise, this value is the set of libraries to be given to the cc and c89 utilities to build an application using a programming model with 32-bit int, long, pointer, and off_t types. _CS_XBS5_ILP32_OFF32_LINTFLAGS If sysconf(_SC_XBS5_ILP32_OFF32) returns -1 the meaning of this value is unspecified. Otherwise, this value is the set of options to be given to the lint utility to check application source using a programming model with 32-bit int, long, pointer, and off_t types. _CS_XBS5_ILP32_OFFBIG_CFLAGS If sysconf(_SC_XBS5_ILP32_OFFBIG) returns -1 the meaning of this value is unspecified. Otherwise, this value is the set of initial options to be given to the cc and c89 utilities to build an application using a programming model with 32-bit int, long, and pointer types, and an off_t type using at least 64 bits. _CS_XBS5_ILP32_OFFBIG_LDFLAGS If sysconf(SC_XBS5_ILP32_OFFBIG) returns -1 the meaning of this value is unspecified. Otherwise, this value is the set of final options to be given to the cc and c89 utilities to build an application using a programming model with 32-bit int, long, and pointer types, and an off_t type using at least 64 bits. _CS_XBS5_ILP32_OFFBIG_LIBS If sysconf(_SC_XBS5_ILP32_OFFBIG) returns -1 the meaning of this value is unspecified. Otherwise, this value is the set of libraries to be given to the cc and c89 utilities to build an application using a programming model with 32-bit int, long, and pointer types, and an off_t type using at least 64 bits. _CS_XBS5_ILP32_OFFBIG_LINTFLAGS If sysconf(_SC_XBS5_ILP32_OFFBIG) returns -1 the meaning of this value is unspecified. Otherwise, this value is the set of options to be given to the lint utility to check an application using a programming model with 32-bit int, long, and pointer types, and an off_t type using at least 64 bits. The confstr() function supports the following values for name, defined in <unistd.h>, for SPARC only: _CS_XBS5_LP64_OFF64_CFLAGS If sysconf(_SC_XBS5_LP64_OFF64) returns -1 the meaning of this value is unspecified. Otherwise, this value is the set of initial options to be given to the cc and c89 utilities to build an application using a programming model with 64-bit int, long, pointer, and off_t types. _CS_XBS5_LP64_OFF64_LDFLAGS If sysconf(_SC_XBS5_LP64_OFF64) returns -1 the meaning of this value is unspecified. Otherwise, this value is the set of final options to be given to the cc and c89 utilities to build an application using a programming model with 64-bit int, long, pointer, and off_t types. _CS_XBS5_LP64_OFF64_LIBS If sysconf(_SC_XBS5_LP64_OFF64) returns -1 the meaning of this value is unspecified. Otherwise, this value is the set of libraries to be given to the cc and c89 utilities to build an application using a programming model with 64-bit int, long, pointer, and off_t types. _CS_XBS5_LP64_OFF64_LINTFLAGS If sysconf(_SC_XBS5_LP64_OFF64) returns -1 the meaning of this value is unspecified. Otherwise, this value is the set of options to be given to the lint utility to check application source using a programming model with 64-bit int, long, pointer, and off_t types. _CS_XBS5_LPBIG_OFFBIG_CFLAGS If sysconf(_SC_XBS5_LPBIG_OFFBIG) returns -1 the meaning of this value is unspecified. Otherwise, this value is the set of initial options to be given to the cc and c89 utilities to build an application using a programming model with an int type using at least 32 bits and long, pointer, and off_t types using at least 64 bits. _CS_XBS5_LPBIG_OFFBIG_LDFLAGS If sysconf(_SC_XBS5_LPBIG_OFFBIG) returns -1 the meaning of this value is unspecified. Otherwise, this value is the set of final options to be given to the cc and c89 utilities to build an application using a programming model with an int type using at least 32 bits and long, pointer, and off_t types using at least 64 bits. _CS_XBS5_LPBIG_OFFBIG_LIBS If sysconf(_SC_XBS5_LPBIG_OFFBIG) returns -1 the meaning of this value is unspecified. Otherwise, this value is the set of libraries to be given to the cc and c89 utilities to build an application using a programming model with an int type using at least 32 bits and long, pointer, and off_t types using at least 64 bits. _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS If sysconf(_SC_XBS5_LPBIG_OFFBIG) returns -1 the meaning of this value is unspecified. Otherwise, this value is the set of options to be given to the lint utility to check application source using a programming model with an int type using at least 32 bits and long, pointer, and off_t types using at least 64 bits. RETURN VALUES
If name has a configuration-defined value, the confstr() function returns the size of buffer that would be needed to hold the entire con- figuration-defined value. If this return value is greater than len, the string returned in buf is truncated. If name is invalid, confstr() returns 0 and sets errno to indicate the error. If name does not have a configuration-defined value, confstr() returns 0 and leaves errno unchanged. ERRORS
The confstr() function will fail if: EINVAL The value of the name argument is invalid. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Mt-Safe | +-----------------------------+-----------------------------+ SEE ALSO
pathconf(2), sysconf(3C), attributes(5), lfcompile(5), lfcompile64(5), standards(5) SunOS 5.11 15 Dec 2003 confstr(3C)
All times are GMT -4. The time now is 08:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy