Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Utility to remove leading space in a file

rpmrajrpmraj Member Posts: 1
Hi,
Basically I am an embedded engineer working for automotive industry, developing software in embedded C.
To collect the metrics we are comparing two files and take the modified/deleted/added lines of code in to account.

For that the present tool is using DOS "sort" option. But the command is considering "leading space" and sort the same lines in different place in different file. If we do line by line comparision, we are getting different output.

I want to have some utility or exe file which will remove the leading space in the file and plan to use "sort" option in that tool. That will resolve my problem.
If any one of you have any exe or utility to remove the leading space in a given file, please share it with me.

Thanks in advance.

Comments

  • LundinLundin Member Posts: 3,711
    Such a program is quite simple to make... a person working as a software engineer should be able to code it in 10 minutes without problems. Open the file, search for leading space, skip it, and store everything else in a second file. You only need functions fopen(), fscanf(), fprintf(), fclose().
  • stars_625stars_625 Member Posts: 6
    : Hi,
    : Basically I am an embedded engineer working for automotive
    : industry, developing software in embedded C.
    : To collect the metrics we are comparing two files and take the
    : modified/deleted/added lines of code in to account.
    :
    : For that the present tool is using DOS "sort" option. But the
    : command is considering "leading space" and sort the same lines in
    : different place in different file. If we do line by line
    : comparision, we are getting different output.
    :
    : I want to have some utility or exe file which will remove the
    : leading space in the file and plan to use "sort" option in that
    : tool. That will resolve my problem.
    : If any one of you have any exe or utility to remove the leading
    : space in a given file, please share it with me.
    :
    : Thanks in advance.
    :

    you can try "Beyond Compare", this tool can automaticly skip useless inf, and mark the different important change use different color
Sign In or Register to comment.