<?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>question How to load .txt file in data source and transform it please any help is appreciated in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/1813056#M469982</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/46859iF95758F8ED41B039/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;this is the sample data of text file&amp;nbsp; first coloumn represents location field and second column asset tag how to load this data in data source if parsing then how do i parse with script&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Oct 2020 07:56:18 GMT</pubDate>
    <dc:creator>ABHAY_M</dc:creator>
    <dc:date>2020-10-23T07:56:18Z</dc:date>
    <item>
      <title>How to load .txt file in data source and transform it please any help is appreciated</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/1813056#M469982</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/46859iF95758F8ED41B039/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;this is the sample data of text file&amp;nbsp; first coloumn represents location field and second column asset tag how to load this data in data source if parsing then how do i parse with script&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 07:56:18 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/1813056#M469982</guid>
      <dc:creator>ABHAY_M</dc:creator>
      <dc:date>2020-10-23T07:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to load .txt file in data source and transform it please any help is appreciated</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/1813057#M469983</link>
      <description>&lt;P&gt;Follow the steps provided in the following page.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.servicenow.com/bundle/orlando-platform-administration/page/administer/import-sets/task/t_ProcessingCustomCSVFiles.html" target="_blank"&gt;https://docs.servicenow.com/bundle/orlando-platform-administration/page/administer/import-sets/task/t_ProcessingCustomCSVFiles.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 08:04:15 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/1813057#M469983</guid>
      <dc:creator>Hitoshi Ozawa</dc:creator>
      <dc:date>2020-10-23T08:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to load .txt file in data source and transform it please any help is appreciated</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/1813058#M469984</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;txt file is not supported out of the box.&lt;/P&gt;
&lt;P&gt;possibly you will have to write custom script to get the txt file content and then transform it&lt;/P&gt;
&lt;P&gt;Regards&lt;BR /&gt;Ankur&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 08:18:54 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/1813058#M469984</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2020-10-23T08:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to load .txt file in data source and transform it please any help is appreciated</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/1813059#M469985</link>
      <description>&lt;P&gt;i have added image of&amp;nbsp; the above sample data how do i tranform it unable to figure out&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 08:32:08 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/1813059#M469985</guid>
      <dc:creator>ABHAY_M</dc:creator>
      <dc:date>2020-10-23T08:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to load .txt file in data source and transform it please any help is appreciated</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/1813060#M469986</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I would suggest to use CSV file&lt;/P&gt;
&lt;P&gt;Regards&lt;BR /&gt;Ankur&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 11:33:44 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/1813060#M469986</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2020-10-23T11:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to load .txt file in data source and transform it please any help is appreciated</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/1813061#M469987</link>
      <description>&lt;P&gt;i have tried with csv file but unable use multiple delimiter as it is saperated by tab and '|' i just cannot import it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 12:01:38 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/1813061#M469987</guid>
      <dc:creator>ABHAY_M</dc:creator>
      <dc:date>2020-10-23T12:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to load .txt file in data source and transform it please any help is appreciated</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/1813062#M469988</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;you should be able to use the delimiter as pipe&lt;/P&gt;
&lt;P&gt;tab character is not shown&lt;/P&gt;
&lt;P&gt;So it would be difficult to load&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/46860iAEB4B0646AD2885D/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Regards&lt;BR /&gt;Ankur&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 12:22:09 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/1813062#M469988</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2020-10-23T12:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to load .txt file in data source and transform it please any help is appreciated</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/1813063#M469989</link>
      <description>&lt;P&gt;One approach is to use the 'Custom (Parse by Script)' format for a data source.&lt;/P&gt;
&lt;P&gt;Based on the file you provided, the following parsing script can be used in the data source:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Parsing Script&lt;/EM&gt;&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;// The input value can be accessed through the variables named "line", "lineNumber" and "result"
// The function uses result variable to return parse result back. 
(function(line, lineNumber, result) {

    var map = {};
    var items = line.split("|");
    map['location'] = items[0];
    map['asset'] = items[1];
    result.addRow(map);

})(line, lineNumber, result);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;EM&gt;Data Source Record&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/46868i2FFE5960E1C26B72/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 23:38:21 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/1813063#M469989</guid>
      <dc:creator>Jon23</dc:creator>
      <dc:date>2020-10-23T23:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to load .txt file in data source and transform it please any help is appreciated</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/1813064#M469990</link>
      <description>&lt;P&gt;Thank you very much &lt;SN-MENTION class="sn-mention" table="live_profile" sysid="c4f09e61db981fc09c9ffb651f96196d"&gt;@jwalton&lt;/SN-MENTION&gt;&amp;nbsp; i searched it like anything over the internet for servicenow but i couldnt found it thank you very much&amp;nbsp; wish You all the best&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Oct 2020 14:44:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/1813064#M469990</guid>
      <dc:creator>ABHAY_M</dc:creator>
      <dc:date>2020-10-24T14:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to load .txt file in data source and transform it please any help is appreciated</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/2448909#M953920</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/133174"&gt;@Jon23&lt;/a&gt; Thanks for sharing this, adding to your script I have utilized this concept to parse midserver logs.&lt;/P&gt;
&lt;P&gt;Since its in .txt format I wanted a way to convert that to data source and import set table to better analyze the data and I didnt want to manually convert it to csv or touch the file, below is the script I created to achieve that.&lt;/P&gt;
&lt;P&gt;// The input value can be accessed through the variables named "line", "lineNumber" and "result"&lt;BR /&gt;// The function uses result variable to return parse result back. &lt;BR /&gt;(function(line, lineNumber, result) {&lt;/P&gt;
&lt;P&gt;var map = {};&lt;BR /&gt;var items = line.split(" ");&lt;BR /&gt;map['datetime'] = items[0];&lt;BR /&gt;var items1 = line.split(" ");&lt;BR /&gt;map['level'] = items1[0];&lt;BR /&gt;map['message'] = items1[1];&lt;BR /&gt;result.addRow(map);&lt;/P&gt;
&lt;P&gt;})(line, lineNumber, result);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 07:18:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/2448909#M953920</guid>
      <dc:creator>VaranAwesomenow</dc:creator>
      <dc:date>2023-01-20T07:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to load .txt file in data source and transform it please any help is appreciated</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/3044279#M1145362</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/133174"&gt;@Jon23&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have idea, on what to use if I will retrieve the data start from row 15. My column header starts in row 14.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Xhare_0-1726217932880.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/385817i67D311BF4D3B73C7/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="Xhare_0-1726217932880.png" alt="Xhare_0-1726217932880.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2024 08:59:29 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/3044279#M1145362</guid>
      <dc:creator>Xhare</dc:creator>
      <dc:date>2024-09-13T08:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to load .txt file in data source and transform it please any help is appreciated</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/3044504#M1145438</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/565656"&gt;@Xhare&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should be able to wrap the code with an 'if' and not start processing until the lineNumber is reached.&amp;nbsp; For example:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// The input value can be accessed through the variables named "line", "lineNumber" and "result"
// The function uses result variable to return parse result back. 
(function(line, lineNumber, result) {

    if (lineNumber &amp;gt; 13) { //  &amp;lt;&amp;lt;&amp;lt;lineNumber starts at 0
        var map = {};
        var items = line.split(",");
        map['UserName'] = items[0];
        map['LastName'] = items[1];
        map['FirstName'] = items[2];
        map['MiddleName'] = items[3];
        map['Organization'] = items[4];
        result.addRow(map);
    }

})(line, lineNumber, result);&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 13 Sep 2024 12:24:39 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/3044504#M1145438</guid>
      <dc:creator>Jon23</dc:creator>
      <dc:date>2024-09-13T12:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to load .txt file in data source and transform it please any help is appreciated</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/3047107#M1146106</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/133174"&gt;@Jon23&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using below script, but still getting data from row 1 until the end of row.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;function&lt;/SPAN&gt;&lt;SPAN&gt;(line, lineNumber, result) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (lineNumber &amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;14&lt;/SPAN&gt;&lt;SPAN&gt;) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; headers = gs.getProperty(&lt;/SPAN&gt;&lt;SPAN&gt;"ccc.ftp.log.extract.headers"&lt;/SPAN&gt;&lt;SPAN&gt;).split(&lt;/SPAN&gt;&lt;SPAN&gt;"|"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; items = line.replace(&lt;/SPAN&gt;&lt;SPAN&gt;/[^\x20-\x7E]/&lt;/SPAN&gt;&lt;SPAN&gt;g&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;''&lt;/SPAN&gt;&lt;SPAN&gt;).split(&lt;/SPAN&gt;&lt;SPAN&gt;","&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; map = {};&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; i = &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;; i &amp;lt; items.length; i++) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; map[headers[i]] = items[i];&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result.addRow(map);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;})(line, lineNumber, result);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 17 Sep 2024 07:09:53 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/3047107#M1146106</guid>
      <dc:creator>Xhare</dc:creator>
      <dc:date>2024-09-17T07:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to load .txt file in data source and transform it please any help is appreciated</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/3065085#M1150729</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/565656"&gt;@Xhare&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you check your end of line (EOL) characters on the file?&lt;/P&gt;&lt;P&gt;Depending on the system creating the file it could be a line feed which may be causing the issue.&amp;nbsp; If it is, try converting EOL to carriage return/line feed.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2024 18:29:09 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-load-txt-file-in-data-source-and-transform-it-please-any/m-p/3065085#M1150729</guid>
      <dc:creator>Jon23</dc:creator>
      <dc:date>2024-10-04T18:29:09Z</dc:date>
    </item>
  </channel>
</rss>

