Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
concatenate variable to set length
Name: fp56 Date: February 8, 2008 at 07:06:25 Pacific OS: Windows XP Pro CPU/Ram: P4 2Gb ram Product: HP
Comment:
I receive files containing vaiable length records on a daily basis which need to be reformatted to a specific length. Is there a way to concatenate these files to a set length? I currently run two different utilities to accomplish this.
Name: klint Date: February 8, 2008 at 08:38:51 Pacific
Reply:
When you say concatenate, do you mean truncate? You may find with a suitable utility like Awk, Perl or Python, you can write a short script to do just that.
0
Response Number 2
Name: Mechanix2Go Date: February 9, 2008 at 05:16:17 Pacific
Reply:
To use the first 10 chars, for instance:
::== @echo off setLocal EnableDelayedExpansion
for /f "tokens=* delims= " %%a in (myfile) do ( set str=%%a set str=!str:~0,10! echo !str! )
===================================== If at first you don't succeed, you're about average.
M2
0
Response Number 3
Name: User123456789 Date: February 11, 2008 at 01:50:36 Pacific
Reply:
As Mechanix states, the SET command has got many useful features
Summary: Hi to set the the variables in vista: Control panel(classic view)--> system --> click on "Advanced system settings" in the left tasks, Envirnoment Variables will appear. Please tell me if it works wit...
Summary: hi all, i have made a batch file which is working perfectly now.. but i don't know how to set ERROR CONTROL in this batch file can any one suggest me any ideas by how can i set error control. here is ...
Summary: In lack of something better you could try a expedient like this (I suppose your need is not to professional ends). @echo off setlocal enabledelayedexpansion set date0=%date% ::set time0=%time:~0,8% se...