How to format the spaces in a text file using bat file scripting

Currently the records in my text file are like this:
100239 0000015.00 
QRP
I want them to be like this:
100266 0000015.00 QRP
There should be 6 spaces before the first column and 8 spaces after that. There should be 1 space between the second and third columns.
Generally this file contains approx 1000 records.
Any help is highly appreciated.
Thank you.

So far it's like this:
for /f "skip=2 delims=*" %%a in (C:\Bonus_File_Export.txt) do (
echo %%a >>C:\newfile.txt    
xcopy C:\newfile.txt C:\Bonus_File_Export.txt /y
del C:\newfile.txt /f /q
I've to format a text file generated by the tool Microstrategy and it feed it to another system in a specific format. Ihave removed the headers with the above script but was unable to remove the spaces between those columns.
You can use this code as a basis for your script:
@echo off
set Line=
if exist d:\temp\newfile.txt del d:\temp\newfile.txt
for /F "skip=2 tokens=1-2" %%a in (d:\temp\test.txt) do call :Sub %%a %%b
goto :eof
:Sub
if not "%2"=="" (
  set Line=      %1        %2
) else (
  echo %Line% %1>>d:\temp\newfile.txt
It works provided that your input file uses this format:
Header line
Header line
100239 0000015.00  
QRP
100240 0000016.00  
QRR
100241 0000017.00  
QRS
100242 0000018.00  
QRT
100243 0000019.00  
QRU
100244 0000020.00  
QRV

Similar Messages

  • How to format the font in Cell when export to Excel file?

    Dear all,
    I am using the CRJ SDK 12 to export to Excel file, but i i want to format the font of Cells in Excel when exporting them.
    Can you help me to solve this issue?
    Thanks,
    Nha

    There's no control over per-cell formatting for Excel exports.
    Sincerely,
    Ted Ueda

  • How to format the output of Today() ⨍(x)  when used in a formula

    This table should explain what I'm asking to do. Have the Wed, Nov 2, 2011 applied to a date when I use the Today() function. Without the workaround of refernencing another cell to pickup formatting like I do in the final row.
    Formula
    Cell Format
    Result
    =CONCATENATE("Today is ",TODAY())"
    Date: Mon,Jan 5, 2009 Time: None
    Today is 02/11/2011
    =TODAY()
    Date: Mon,Jan 5, 2009 Time: None
    Wed, Nov 2, 2011
    = CONCATENATE("Today is ",C3)
    Date: Mon,Jan 5, 2009 Time: None
    Today is Wed, Nov 2, 2011

    Hi Barry
    I just discover this thread.
    The main problem here is that as we aren't allowed to define the format used by TODAY() in the described formula, we have to use a formula which is localization dependant which is really annoying.
    For my own use, I will just use two columns :
    In the first one the formula would be :
    =IF(MID(""&1/2,2,1)=".","Nous sommes le","Today is")
    In the second one it would be :
    =TODAY()
    The vertical border between the two columns is set to white.
    But I think that the most efficient answer would be that Apple give us the ability to pass a parameter to TODAY() and/or NOW().
    This parameter would define the format which would remain the current one when the parameter is omitted.
    Yvan KOENIG (VALLAURIS, France)  07 /11 /2011 17:38:15
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • How to create the Export Data and Import Data using flat file interface

    Hi,
    Request to let me know based on the requirement below on how to export and import data using flat file interface.....
    Please provide the steps involved for the same.......
    BW/BI - Recovery Process for SNP data. 
    For each SNP InfoProvider,
    create:
    1) Export Data:
    1.a)  Create an export data source, InfoPackage, comm structure, etc. necessary to create an ASCII fixed length flat file on the XI
    ctnhsappdata\iface\SCPI063\Out folder for each SNP InfoProvider. 
    1.b)  All fields in each InfoProvider should be exported and included in the flat file. 
    1.c)  A process chain should be created for each InfoProvider with a start event. 
    1.d)  If the file exists on the target drive it should be overwritten. 
    1.e)  The exported data file name should include the InfoProvider technical name.
    1.f)  Include APO Planning Version, Date of Planning Run, APO Location, Calendar Year/Month, Material and BW Plant as selection criteria.
    2) Import Data:
    2.a) Create a flat file source system InfoPackage, comm structure, etc. necessary to import ASCII fixed length flat files from the XI
    ctnhsappdata\iface\SCPI063\Out folder for each SNP InfoProvider.
    2.b)  All fields for each InfoProvider should be mapped and imported from the flat file.
    2.c)  A process chain should be created for each InfoProvider with a start event. 
    2.d)  The file should be archived in the
    ctnhsappdata\iface\SCPI063\Archive directory.  Each file name should have the date appended in YYYYMMDD format.  Each file should be deleted from the \Out directory after it is archived. 
    Thanks in advance.
    Tyson

    Here's some info on working with plists:
    http://developer.apple.com/documentation/Cocoa/Conceptual/PropertyLists/Introduc tion/chapter1_section1.html
    They can be edited with any text editor. Xcode provides a graphical editor for them - make sure to use the .plist extension so Xcode will recognize it.

  • Both my boss and I have the iPhone 5C for Verizon.  When I text, I have the little microphone next to the space bar, allowing me to use the speech to text function.  He does not.  How do you turn this on or remedy this problem?

    Both my boss and I have the iPhone 5C for Verizon.  When I text, I have the little microphone next to the space bar, allowing me to use the speech to text function.  He does not.  How do you turn this on or remedy this problem?

    Does your boss have Siri turned ON? See Settings > General > Siri.

  • How to change the font size of text and case in smartforms

    hi,
       could any one explain how to change the font size of text in smartforms. ex. previously i had taken P4 left aligned and C6 but now i want to decrease the font without making it bold. pl......... guide me
       secondly the value which are coming from tables are upper case but i need lower case. pl. guide
    thanking u

    check out the smart styles...create a font of ur size n use.
    Define the paragraphs & character formats using SMARTSTYLES & use them in your smartform.
    You have to give the smartstyle name in the Form attributes-->Output options for the formats to be used in your smartform.
    You can define font size in Smartform Style.
    Smartform Styles > Charcterformat> Font --> size.
    to load the font to SAP server chk this
    Re: Adding a new font for SAPscript/SMARTFORM output
    Regards
    Vasu

  • How to change the font size of text element in smartform

    Hi
    i want to know how to change the font size of text element in smartform
    regards
    Gincy

    Hi
    You can create Smartstyles, in which you can define paragraph formats for texts and character formats for character level changes.
    Paragraph format ---> alignment, font size etc
    character format for ---> superscript, subscript.
    After creating, in your smartform, there will be a option in the text element to enter a style.
    You give the created style and you can use the paragraph and character formats i that style.
    Hope this is clear..
    Regards
    Sekar

  • How to manage the space between a table and its title?

    Have tables where titles are very close to the main text and need a couple of points to separate these elements. How to reshape this space?
    1. Titles were separated by a return that is not  visible...  (any code is revealed by ID)
    2. When a Return is inserted after the title, nothing happens aparently, but this return is now visible and could be used as a «paragraph space after» value:
    3. A solution could be Grep to catch the end of paragraph assigned to titles to insert a return;
    but Grep only catches the right border of the table (the yellow mark shows the big blinking cursor);
    Grep cannot see the end of paragraph in the tables's title.
    It another method?
    Basically, how to modify the space between a table and ists title

    I think you and Bob are not in synch here.
    Bob suggested that you could use paragraph spacing, but for that to work you do need to use separate paragraphs for the title and table, which you don't seem to be doing. Using GREP to find the end of the paragraph only works if there IS and end to the paragraph. As far as I know there is now meta-character to use in Find/Change that would allow you to find a table and insert a paragraph break ahead of it, but I bet it could be scripted.
    I'm not quite sure what you were trying to find in the GREP you posted. Did you actually have a paragraph return inserted already after the title? In that case you only need to redefine the style for that paragraph to add the space (or redefine the style for the paragraph that holds the table itself). You don't need the GREP. But the reason it does nothing is that you've found a location -- the end of the paragraph, but haven't found any actual text to modify. To do anything you would need to use something like .$
    But back to NOT having a separate paragraph... If you put the cursor in any table cell and go to Table Options > Table Setup tab you'll see fields to set space before and after the table that should do what you want. That was the second part of what he posted.

  • Can't figure out how to maximize the space on the page by increasing the column width

    Trouble with pages app:
    can't figure out how to maximize the space on the page by increasing the column width
    I have 3 columns and they have spaces btw them that I cannot close the gap on.

    Whatever the version, you can click on the gutter figure and edit it.
    Click once on the column and a second time on the Gutter measurement.
    Peter

  • How to read the content of a text file (by character)?

    Guys,
    Good day!
    I'm back just need again your help. Is there anyone knows how to read the content of a text file not by line but by character.
    Please help me. Thank you so much in advance.
    Jojo

    http://java.sun.com/javase/6/docs/api/index.html
    package java.io
    InputStream.read(): int
    Reads the next byte of data from the input stream.
    Implementation:
    InputStreamReader
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes them into characters using a specified charset. The charset that it uses may be specified by name or may be given explicitly, or the platform's default charset may be accepted.

  • How will check the space taken by a single table in a tablespace ?

    How will check the space taken by a single table in a tablespace ?
    dba_segments is giving the same values even if I truncate the table?
    Pls reply

    I need to know how can we find out the size of the table in the tablespace.use user_segments (bytes) column.
    How much bytes it has taken ?value from user_segments, bytes column
    If u delete records will the space be used for another table in same tablespace?No, it keep the space in the same table for future usage.
    How can we free that space ?truncate or drop the table and reduce the size from tablespace, if you want to reclaim the space from the tablespace, OS level.
    Jaffar

  • How to reduce the level of free text / direct purchasing

    A common problem at all sites is how to reduce the level of free text / direct / non catalogue based purchasing. This is where users enter an account assignment and free text instead of using an existing material number.
    This is often the case because it is too "dificult" for the user to search and find the correct material number.
    How have other sites handled this?
    has anyone found a solution that if a user enters lets say "paper" into the free text box, a pop up appears with a match on possible materials with the word "paper" in the short description? This sounds like a pretty easy function to implement? Does anyone have the code?
    Cheerio

    >
    Ravi.or.raj wrote:
    > The search function you ask for is pretty much a standard functionality.
    > In ME21N , click on  "Personal Settings"    , and select the check box "int search help on"  .
    Yes this works, but you have to tell that the user has to enter the text  in the material number field, then SAP will search thru the database.

  • How to change the font size of Text Box  Properties Appearance tab into 2 decimal digit.

    How to change the font size of Text Box  Properties Appearance tab into 2 decimal digit. I am uanble to modify it to 5.38 pt for example. Its only allowing to 1 decimal place.

    Click on each field and the choose Properties from either File menu (or if on Mac hold dow mouse button until context menu appears choose properties)
    go to Font
    choose desired size and type font,you can choose to make this the default.
    Do this with each field.
    Or if you have a lot of fields:
    while one is selected select all of them
    then go to fonts in properties
    change Font and size and make default.

  • How to change the font size of Text box tool ?

    How to change the font size of Text box tool ?
    I am using Acrobat PDF 6.0
    Tools > Advanced Commenting > Text Box Tool
    I need to know how to change the font size. The default font size is too big.
    let me know
    Thanks

    I do not have AA6 available right now (I can check at home this evening). I am also using AA Pro, not Std. In AA7, there is a text box tool that is a commenting tool. When I started typing, a properties toolbar came up that had the font size and such. I haven't figured out how to get the toolbar after the fact. In AA8, I selected the text box tool and then went to view and selected the properties bar (the font size and all showed then), or use Ctrl-E when editing the text. I have not been able to figure out how to edit the text in a text box after you have created it - think it is a mental block right now. Bill

  • How to color the background of a text line in mail

    How to color the background of a text line in mail
    The forum has a message dated 2005 that this cannot be done, has the recent OS made this a feature.
    I still caanot seem to see any where it is available.
    Thanks
    Greg

    greg1424 wrote:
    Does pages do that?
    Yes.
    I also have Office for MAC but rarely use it as it is too cumbersome for me.
    Microsoft Office does it also.  So does Libre Office, Open Office and just about any full function word processor app.
    Dan

Maybe you are looking for

  • Animation Preset not visible

    I've downloaded the Amortype preset from Mattrunks. I've copied it to the presets folder in the After Effects CC folder. When I search for the preset in the "effects & presets" window in AE, it's not visible. When I browse for the preset in Bridge, i

  • Sound in Java 1.1

    I need to play a sound clip on a Jornada using PJava (which is Java 1.1) I found some code but it makes the clip all stuttery and broken up. Is there anyway of either a) playing a clean sound clip b) playing a Tone in Java 1.1 rather than a sound cli

  • Peculiar behaviour with pathfinder/apply stroke to group

    Hello all! Although I have lurked on this forum for a while, this is my first post, so apologies for any etiquette breach! I've been using Illustrator (CS4/MacOSX) for a while, but every now and then it throws me a curve ball. Either that or I'm havi

  • Updating of shared variable

    Hello There I am using Shared variables (SV) on an RT host. The use of these variables seems to be functioning correctly. However, after certain events, which are not that frequent, I write the values in this variables to a spreadsheet.  What has hap

  • Derived roles are getting overwritten everytime when I update Master Role.

    Hi Experts ! We have created some Master and Derived roles in the past.  According to the requirement we have made some changes directly in the derived roles like some value of objects, activities, etc.. Now we added one t-code in the master role and