Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Remove or truncate trailing nulls from file Post 302975325 by Tribe on Saturday 11th of June 2016 05:39:06 AM
Old 06-11-2016
Thank you very much, it works perfectly.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to remove trailing spaces

Hi, I have a file like this (ADD_MONTHS((Substr(Trim(BOTH FROM Translate(Maximum(closeDa ------------------------------------------------------------ 2007-06-30 00:00:00 I have a requirement where i need just the date. When i do: tail -1... (2 Replies)
Discussion started by: mahek_bedi
2 Replies

2. Shell Programming and Scripting

Remove trailing G

Hello, I am trying to write a script that will calculate the amount of data remaining in a storage volume. I'm running Tru64 Unix version 5.1B patch kit 6. The script is being run against an AdvFS domain. I am programming in Korn Shell version M-11/16/88f. The basic idea is that I want to run df... (3 Replies)
Discussion started by: Heathe_Kyle
3 Replies

3. UNIX for Dummies Questions & Answers

I don't want to truncate trailing spaces and ^M at the end of line

I have a script wherein I access each line of the file using a FOR loop and then perform some operations in each line. The problem is each line that gets extracted in FOR loop truncates trailing blank spaces and control characters (^M) that is present at the end of each line. I don't wan this to... (5 Replies)
Discussion started by: Shobana_s
5 Replies

4. Shell Programming and Scripting

Remove trailing spaces from file

I'm currently writing my sql results to a file and they have trailing spaces after each field. I want to get rid of these spaces and I'm using this code: TVXTEMP=$(echo $TVXTEMP|sed -e 's/\ //g') It doesn't work though. I'm not familiar with sedscript, and the other codes I've found online... (6 Replies)
Discussion started by: avillanueva
6 Replies

5. Shell Programming and Scripting

Remove trailing zeros

Hi I have a simple request but can't find the answer. I want to remove trailing zeros, and in some cases the fullstops, from the input data. Example of input file: FR002_15.000_20.000 SD475_5.000_10.500 FG5647_12.250_15.500 BH2463_30.555_32.000 Desired output file would be: ... (10 Replies)
Discussion started by: theflamingmoe
10 Replies

6. Shell Programming and Scripting

Remove trailing 0 from the field

Hi Freinds, I have file1.txt as below file1.txt 1521894~~-0.400~201207 1521794~~-0.486~201207 152494~~-0.490~201207 152154894~~-0.490~201207 1521894354~~-0.489~201207 expected output : 1521894~~-0.4~201207 1521794~~-0.486~201207 152494~~-0.49~201207... (9 Replies)
Discussion started by: i150371485
9 Replies

7. Shell Programming and Scripting

Remove trailing number

I have some strings such as ABC1 ABC2 TYFASDD12 They will only have letters and numbers. In each case I want to remove the last digit? The lengths will vary. So a hard coded substr won't work. What do I do? if it doesn't end in a number, I don't want to remove any characters. (6 Replies)
Discussion started by: guessingo
6 Replies

8. Shell Programming and Scripting

Remove trailing space from file and folder names

I have a folder that contains many sub folders and files. This tree has to be backed up to an archive system. According to the tech support, one of the archives is failing to back up due to the possibility of trailing spaces on file and folder names. Therefore, I would like to have a script... (16 Replies)
Discussion started by: vipertech
16 Replies

9. Shell Programming and Scripting

Remove the leading and trailing date from a CSV file

I'm a newbie to shell scripting. Can anyone help with the below requirement ? The leading and trailing date of a files to be removed. 2017-07-12_gmr_tag_log_20170711.csv 2017-07-12_gmr_call_log_20170711.csv 2017-07-12_gmr_outgoing_log_20170711.csv I'm looking for output like... (7 Replies)
Discussion started by: shivamayam
7 Replies

10. Shell Programming and Scripting

Remove leading and trailing spaces from a file

Hi, I am trying to remove leading and trailing spaces from a file using awk but somehow I have not been able to do it. Here is the data that I want to trim. 07/12/2017 15:55:00 |entinfdev |AD ping Time ms | .474| 1.41| .581|green |flat... (9 Replies)
Discussion started by: svajhala
9 Replies
cvmkfile(1)                                                        cvmkfile(1)

NAME
cvmkfile - Create a pre-allocated file SYNOPSIS
cvmkfile [-k <key>] [-p] [-s] [-w] [-z] <size>[k|m|g] <filename> DESCRIPTION
cvmkfile can be used to pre-allocate a file on the Xsan volume. This is useful and preferable when preparing a file for use in a real-time or streaming environment as the entire file is represented in only one file system extent. Additionally, a file can be placed onto a specific storage pool by specifying the <key> value, which is used as the affin- ity locator. See cvfs_config(4) for more details about affinities. USAGE
The -k <key> optionally tells the file system where to place the data file. If an Affinity Key is specified, the file is placed on storage pools that are specified to support this key. If there is no storage pool with the key specified, then the file is placed in non-exclusive data pools. If there are no non-exclusive data pools, then ENOSPC (no space) is returned. The -p option forces the allocation and any subsequent expansions to be fitted "perfectly" as multiples of the InodeExpandMin configuration parameter. The allocation extent will always line up on and be a per- fect multiple of the blocks specified in InodeExpandMin. The -s option forces the allocation to line up on the beginning block modulus of the storage pool. This can help performance in situations where the I/O size perfectly spans the width of the storage pool's disks. The -w option sets the file size to be equal to <size>. Without this option the blocks are allocated but the size is set to zero. NOTE: Unless the -z option is used, the new file will contain undefined data. Using the -w option is not recommended unless absolutely needed. The -z option causes the file to be physically zeroed out. This can take a significant amount of time. The <size> argument specifies the number of bytes, kilobytes(k), megabytes(m) or gigabytes(g) to allocate for the file. There is no guarantee that all requested space will be allocated. If there is insufficient contiguous available space to satisfy the requested amount then a "best effort" will be performed. In this case a success value is returned even though not all of the requested amount is allocated to the file. Even though the allocation may not be fully satisfied, if the -w option is specified then the file size will still reflect the requested <size> value. EXAMPLES
Make a file of one gigabyte with zero length. Allocate it on a storage pool that favors the media type 6100_n8. rock # cvmkfile -k 6100_n8 1g foobar SEE ALSO
cvfs_config(4), cvmkdir(1) Xsan File System December 2005 cvmkfile(1)
All times are GMT -4. The time now is 12:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy