title: How to Import CSV File and Text File In Type Script
body: <br>
  All I need help i'm new on angular-6. My question is how to `import the csv or text file in typescript` like below example for json i import file
  <br>
  1) Example:-
  I store the json file in folder under the app folder like
  file name login.json
  <pre><code>{
      &quot;email&quot;: &quot;nabeel.amd9@gmail.com&quot;,
      &quot;password&quot;: &quot;Balc&quot;
  }
  </code></pre>
  <p>and declare the module like <code>json.d.ts</code> <br></p>
  <blockquote>
  <p>This will allow you to load <code>.json</code> files from disk</p>
  </blockquote>
  <pre><code>declare module &quot;*.json&quot; {
      const value: any;
      export default value;
  }
  </code></pre>
  <p>and import this file json file as <br></p>
  <pre><code>//# json import
  import jsonData from '../common/json/jsondata.json';
  export const JsonResouce = &lt;IJsondata&gt; jsonData;
  
  export interface IJsondata {
      email: string;
      password: string;
  }
  </code></pre>
  <p>that above example work for me while the same process i use for parse the csv and text file but it's sow error</p>
  <blockquote>
  <p>ERROR in ./src/app/common/text/info.txt Module parse failed:
  Unexpected token (1:9) You may need an appropriate loader to handle
  this file type. | Pakistan zindabad <br>
  ERROR in ./src/app/common/csv/latlong.csv Module parse failed: Unexpected token
  (2:4) You may need an appropriate loader to handle this file type. |
  name, lat, long | Pir Mahal, Toba Tek Singh, Punjab, Pakistan<br />
  30.767956       72.437813</p>
  </blockquote>
  <p>My Code for both csv and text file are :- <br></p>
  <pre><code>// # csv file
  import csvData from './latlong.csv';
  //# text import
  import textData from '../common/text/info.txt';
  //# json import
  import jsonData from '../common/json/jsondata.json';
  
  
  export const TextResource = textData; // not-work
  export const JsonResource = &lt;IJsondata&gt; jsonData; // work
  export const CsvResource = &lt;ILatLong[]&gt; csvData; // not-work
  
  export interface IJsondata {
      email: string;
      password: string;
  }
  
  export interface ILatLong {
      name: string;
      lat: any;
      long: any;
  }
  
  declare module &quot;*.txt&quot; {
      const content: string;
      export default content;
  }
  
  declare module '*.csv' {
      const value: any;
      export default value;
  }
  </code></pre>
  <p>is for csv|txt import file possible in that way?</p>