<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: convert filenames in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/convert-filenames/m-p/5017738#M96820</link>
    <description>Christian,&lt;BR /&gt;a bit more info required, such as fix format ?&lt;BR /&gt;&lt;BR /&gt;Otherwise:&lt;BR /&gt;file="BA_D05.12.2006.txt"&lt;BR /&gt;new_file=`echo $file | cut -c 1-4``echo $file | cut -c11-14``echo $file | cut -c8-9``echo $file | cut -c5-6``echo $file | cut -c15-`&lt;BR /&gt;echo $new_file&lt;BR /&gt;BA_D20061205.txt&lt;BR /&gt;</description>
    <pubDate>Fri, 08 Dec 2006 06:23:04 GMT</pubDate>
    <dc:creator>Peter Godron</dc:creator>
    <dc:date>2006-12-08T06:23:04Z</dc:date>
    <item>
      <title>convert filenames</title>
      <link>https://community.hpe.com/t5/operating-system-linux/convert-filenames/m-p/5017737#M96819</link>
      <description>hello@all,&lt;BR /&gt;I have some files with date in filename. Now I#ve to convert the date format in the filename from DD.MM.YYYY to YYYYMMDD.&lt;BR /&gt;Sample:&lt;BR /&gt;original filename is: BA_D07.12.2006.txt&lt;BR /&gt;after converting it should be: BA_D20061207.txt&lt;BR /&gt;&lt;BR /&gt;Can anyone help me? I've no idea how to do.&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;Christian</description>
      <pubDate>Fri, 08 Dec 2006 06:08:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/convert-filenames/m-p/5017737#M96819</guid>
      <dc:creator>Christian Marquardt_1</dc:creator>
      <dc:date>2006-12-08T06:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: convert filenames</title>
      <link>https://community.hpe.com/t5/operating-system-linux/convert-filenames/m-p/5017738#M96820</link>
      <description>Christian,&lt;BR /&gt;a bit more info required, such as fix format ?&lt;BR /&gt;&lt;BR /&gt;Otherwise:&lt;BR /&gt;file="BA_D05.12.2006.txt"&lt;BR /&gt;new_file=`echo $file | cut -c 1-4``echo $file | cut -c11-14``echo $file | cut -c8-9``echo $file | cut -c5-6``echo $file | cut -c15-`&lt;BR /&gt;echo $new_file&lt;BR /&gt;BA_D20061205.txt&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Dec 2006 06:23:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/convert-filenames/m-p/5017738#M96820</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-12-08T06:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: convert filenames</title>
      <link>https://community.hpe.com/t5/operating-system-linux/convert-filenames/m-p/5017739#M96821</link>
      <description>&lt;!--!*#--&gt;What you need to do is use sed in a for-loop:&lt;BR /&gt;for file in BA_D??.??.????.txt; do&lt;BR /&gt;   echo mv $file $(echo $file | \&lt;BR /&gt;     sed -e 's/BA_D\(..\)\.\(..\)\.\(....\)/BA_D\3\2\1/')&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Remove the "echo" above when you are sure that the mv commands are proper.&lt;BR /&gt;&lt;BR /&gt;The for-loop uses shell pattern matching regexp(5).  sed uses basic regular expressions regexp(5).&lt;BR /&gt;&lt;BR /&gt;\( and \) bracket chunks that can be referenced by \#, their position.  And I need to quote the "." since they are special.</description>
      <pubDate>Fri, 08 Dec 2006 06:24:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/convert-filenames/m-p/5017739#M96821</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2006-12-08T06:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: convert filenames</title>
      <link>https://community.hpe.com/t5/operating-system-linux/convert-filenames/m-p/5017740#M96822</link>
      <description>Dennis' way works fine.&lt;BR /&gt;It's a very strange script but it works fine ;-)&lt;BR /&gt;&lt;BR /&gt;Thanks a lot!!!!&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;Christian</description>
      <pubDate>Fri, 08 Dec 2006 06:55:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/convert-filenames/m-p/5017740#M96822</guid>
      <dc:creator>Christian Marquardt_1</dc:creator>
      <dc:date>2006-12-08T06:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: convert filenames</title>
      <link>https://community.hpe.com/t5/operating-system-linux/convert-filenames/m-p/5017741#M96823</link>
      <description>it works</description>
      <pubDate>Fri, 08 Dec 2006 06:59:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/convert-filenames/m-p/5017741#M96823</guid>
      <dc:creator>Christian Marquardt_1</dc:creator>
      <dc:date>2006-12-08T06:59:00Z</dc:date>
    </item>
  </channel>
</rss>

